diff --git a/include/diagnostic/vdtdiag_fcnTuples.h b/include/diagnostic/vdtdiag_fcnTuples.h index db510d0..b4d7b79 100644 --- a/include/diagnostic/vdtdiag_fcnTuples.h +++ b/include/diagnostic/vdtdiag_fcnTuples.h @@ -63,7 +63,7 @@ void getFunctionTuples( std::vector>* fcn_tuples, fcn_tuples->clear(); fcn_tuples->push_back(genfpfcn2D_tuple( "Identity2D", identity2D, moneone2Pool.getNumbersX(), moneone2Pool.getNumbersY() )); - fcn_tuples->push_back(genfpfcn2D_tuple( "Atan2", atan2, moneone2Pool.getNumbersX(), moneone2Pool.getNumbersY() )); + fcn_tuples->push_back(genfpfcn2D_tuple( "Atan2", refMath::atan2, moneone2Pool.getNumbersX(), moneone2Pool.getNumbersY() )); fcn_tuples->push_back(genfpfcn2D_tuple( "Fast_Atan2", fast_atan2, moneone2Pool.getNumbersX(), moneone2Pool.getNumbersY() )); } @@ -73,7 +73,7 @@ void getFunctionTuples( std::vector>* fcn_tuples, fcn_tuples->clear(); fcn_tuples->push_back(genfpfcn2D_tuple( "Identity2Df", identity2Df, moneone2Pool.getNumbersX(), moneone2Pool.getNumbersY() )); - fcn_tuples->push_back(genfpfcn2D_tuple( "Atan2f", atan2f, moneone2Pool.getNumbersX(), moneone2Pool.getNumbersY() )); + fcn_tuples->push_back(genfpfcn2D_tuple( "Atan2f", refMath::atan2f, moneone2Pool.getNumbersX(), moneone2Pool.getNumbersY() )); fcn_tuples->push_back(genfpfcn2D_tuple( "Fast_Atan2f", fast_atan2f, moneone2Pool.getNumbersX(), moneone2Pool.getNumbersY() )); } @@ -109,15 +109,15 @@ void getFunctionTuples( std::vector>* fcn_tuples, fcn_tuples->clear(); fcn_tuples->push_back(genfpfcn_tuple( "Identity", identity, symmetricrPool.getNumbers() )); - fcn_tuples->push_back(genfpfcn_tuple( "Exp", exp, expPool.getNumbers() )); - fcn_tuples->push_back(genfpfcn_tuple( "Log", log, positiverPool.getNumbers() )); - fcn_tuples->push_back(genfpfcn_tuple( "Sin", sin, symmetricrPool.getNumbers() )); - fcn_tuples->push_back(genfpfcn_tuple( "Cos", cos, symmetricrPool.getNumbers() )); - fcn_tuples->push_back(genfpfcn_tuple( "Tan", tan, symmetricrPool.getNumbers() )); - fcn_tuples->push_back(genfpfcn_tuple( "Tanh", tanh, symmetricrPool.getNumbers() )); - fcn_tuples->push_back(genfpfcn_tuple( "Asin", asin, mone2onerPool.getNumbers() )); - fcn_tuples->push_back(genfpfcn_tuple( "Acos", acos, mone2onerPool.getNumbers() )); - fcn_tuples->push_back(genfpfcn_tuple( "Atan", atan, symmetricrPool.getNumbers() )); + fcn_tuples->push_back(genfpfcn_tuple( "Exp", refMath::exp, expPool.getNumbers() )); + fcn_tuples->push_back(genfpfcn_tuple( "Log", refMath::log, positiverPool.getNumbers() )); + fcn_tuples->push_back(genfpfcn_tuple( "Sin", refMath::sin, symmetricrPool.getNumbers() )); + fcn_tuples->push_back(genfpfcn_tuple( "Cos", refMath::cos, symmetricrPool.getNumbers() )); + fcn_tuples->push_back(genfpfcn_tuple( "Tan", refMath::tan, symmetricrPool.getNumbers() )); + fcn_tuples->push_back(genfpfcn_tuple( "Tanh", refMath::tanh, symmetricrPool.getNumbers() )); + fcn_tuples->push_back(genfpfcn_tuple( "Asin", refMath::asin, mone2onerPool.getNumbers() )); + fcn_tuples->push_back(genfpfcn_tuple( "Acos", refMath::acos, mone2onerPool.getNumbers() )); + fcn_tuples->push_back(genfpfcn_tuple( "Atan", refMath::atan, symmetricrPool.getNumbers() )); fcn_tuples->push_back(genfpfcn_tuple( "Isqrt", isqrt, positiverPool.getNumbers() )); fcn_tuples->push_back(genfpfcn_tuple( "Inverse", inv, symmetricrPool.getNumbers() )); @@ -155,15 +155,15 @@ void getFunctionTuples( std::vector>* fcn_tuples, fcn_tuples->clear(); fcn_tuples->push_back(genfpfcn_tuple( "Identityf", identityf, symmetricrPool.getNumbers() )); - fcn_tuples->push_back(genfpfcn_tuple( "Expf", expf, expPool.getNumbers() )); - fcn_tuples->push_back(genfpfcn_tuple( "Logf", logf, positiverPool.getNumbers() )); - fcn_tuples->push_back(genfpfcn_tuple( "Sinf", sinf, symmetricrPool.getNumbers() )); - fcn_tuples->push_back(genfpfcn_tuple( "Cosf", cosf, symmetricrPool.getNumbers() )); - fcn_tuples->push_back(genfpfcn_tuple( "Tanf", tanf, symmetricrPool.getNumbers() )); - fcn_tuples->push_back(genfpfcn_tuple( "Tanhf", tanhf, symmetricrPool.getNumbers() )); - fcn_tuples->push_back(genfpfcn_tuple( "Asinf", asinf, mone2onerPool.getNumbers() )); - fcn_tuples->push_back(genfpfcn_tuple( "Acosf", acosf, mone2onerPool.getNumbers() )); - fcn_tuples->push_back(genfpfcn_tuple( "Atanf", atanf, symmetricrPool.getNumbers() )); + fcn_tuples->push_back(genfpfcn_tuple( "Expf", refMath::expf, expPool.getNumbers() )); + fcn_tuples->push_back(genfpfcn_tuple( "Logf", refMath::logf, positiverPool.getNumbers() )); + fcn_tuples->push_back(genfpfcn_tuple( "Sinf", refMath::sinf, symmetricrPool.getNumbers() )); + fcn_tuples->push_back(genfpfcn_tuple( "Cosf", refMath::cosf, symmetricrPool.getNumbers() )); + fcn_tuples->push_back(genfpfcn_tuple( "Tanf", refMath::tanf, symmetricrPool.getNumbers() )); + fcn_tuples->push_back(genfpfcn_tuple( "Tanhf", refMath::tanhf, symmetricrPool.getNumbers() )); + fcn_tuples->push_back(genfpfcn_tuple( "Asinf", refMath::asinf, mone2onerPool.getNumbers() )); + fcn_tuples->push_back(genfpfcn_tuple( "Acosf", refMath::acosf, mone2onerPool.getNumbers() )); + fcn_tuples->push_back(genfpfcn_tuple( "Atanf", refMath::atanf, symmetricrPool.getNumbers() )); fcn_tuples->push_back(genfpfcn_tuple( "Isqrtf", isqrtf, positiverPool.getNumbers() )); fcn_tuples->push_back(genfpfcn_tuple( "Inversef", invf, symmetricrPool.getNumbers() )); @@ -247,7 +247,7 @@ void getFunctionTuplesvect(std::vector>* fcn_tuples, randomPool& expPool){ fcn_tuples->clear(); - fcn_tuples->push_back(genfpfcnv_tuple( "Identityfv", identityfv, symmetricrPool.getNumbers() )); + fcn_tuples->push_back(genfpfcnv_tuple( "Identityfv", identityfv, symmetricrPool.getNumbers() )); fcn_tuples->push_back(genfpfcnv_tuple( "Expfv", vdt::expfv, expPool.getNumbers() )); fcn_tuples->push_back(genfpfcnv_tuple( "Logfv", vdt::logfv, positiverPool.getNumbers() )); fcn_tuples->push_back(genfpfcnv_tuple( "Sinfv", vdt::sinfv, symmetricrPool.getNumbers() )); diff --git a/include/diagnostic/vdtdiag_helper.h b/include/diagnostic/vdtdiag_helper.h index 39fa6b4..6dcb6f5 100644 --- a/include/diagnostic/vdtdiag_helper.h +++ b/include/diagnostic/vdtdiag_helper.h @@ -41,6 +41,30 @@ #include #endif +// Wrappers to support macos 10.14 https://github.com/dpiparo/vdt/issues/9 +namespace refMath { +double atan2(double x, double y) { return ::atan2(x, y); } +float atan2f(float x, float y) { return ::atan2f(x, y); } +double tan(double x) { return ::tan(x); } +float tanf(float x) { return ::tanf(x); } +double atan(double x) { return ::atan(x); } +float atanf(float x) { return ::atanf(x); } +double tanh(double x) { return ::tanh(x); } +float tanhf(float x) { return ::tanhf(x); } +double exp(double x) { return ::exp(x); } +float expf(float x) { return ::expf(x); } +double log(double x) { return ::log(x); } +float logf(float x) { return ::logf(x); } +double sin(double x) { return ::sin(x); } +float sinf(float x) { return ::sinf(x); } +double asin(double x) { return ::asin(x); } +float asinf(float x) { return ::asinf(x); } +double cos(double x) { return ::cos(x); } +float cosf(float x) { return ::cosf(x); } +double acos(double x) { return ::acos(x); } +float acosf(float x) { return ::acosf(x); } +} + namespace{ diff --git a/progs/units/acos_test.cpp b/progs/units/acos_test.cpp index b931e76..fe78a8c 100644 --- a/progs/units/acos_test.cpp +++ b/progs/units/acos_test.cpp @@ -19,12 +19,12 @@ int main(){ //dp double dpvals[size]={1,.9,.8,.6,1e-200,0,-0.00004,-.2,-.8,-0.9999999999}; - printFuncDiff("acos", (dpdpfunction)acos,(dpdpfunction)fast_acos, dpvals, size); + printFuncDiff("acos", (dpdpfunction)refMath::acos,(dpdpfunction)fast_acos, dpvals, size); printFuncDiff ("acosv", (dpdpfunctionv) acosv, (dpdpfunctionv) fast_acosv, dpvals, size ); //sp float spvals[size]={1.f,.9f,.8f,.12f,1e-20f,0.f,-0.004f,-.2f,-.8f,-0.9999999999f}; - printFuncDiff("acosf", (spspfunction)acosf,(spspfunction)fast_acosf,spvals,size); + printFuncDiff("acosf", (spspfunction)refMath::acosf,(spspfunction)fast_acosf,spvals,size); printFuncDiff ("acosfv", (spspfunctionv) acosfv, (spspfunctionv) fast_acosfv, spvals, size ); } diff --git a/progs/units/asin_test.cpp b/progs/units/asin_test.cpp index fa4a4ae..c8f78dc 100644 --- a/progs/units/asin_test.cpp +++ b/progs/units/asin_test.cpp @@ -19,13 +19,13 @@ int main(){ // dp double dpvals[size]={1,.9,.8,.6,1e-200,0,-0.00004,-.2,-.8,-0.9999999999}; - printFuncDiff("asin", (dpdpfunction)asin,(dpdpfunction)fast_asin,dpvals,size); + printFuncDiff("asin", (dpdpfunction)refMath::asin,(dpdpfunction)fast_asin,dpvals,size); printFuncDiff ("asinv", (dpdpfunctionv) asinv, (dpdpfunctionv) fast_asinv, dpvals, size ); //sp float spvals[size]={1,.9,.8,.12,1e-200,0,-0.004,-.2,-.8,-0.9999999999}; - printFuncDiff("asinf", (spspfunction)asinf,(spspfunction)fast_asinf,spvals,size); + printFuncDiff("asinf", (spspfunction)refMath::asinf,(spspfunction)fast_asinf,spvals,size); printFuncDiff ("asinfv", (spspfunctionv) asinfv, (spspfunctionv) fast_asinfv, spvals, size ); } diff --git a/progs/units/atan2_test.cpp b/progs/units/atan2_test.cpp index caed816..d416a5e 100644 --- a/progs/units/atan2_test.cpp +++ b/progs/units/atan2_test.cpp @@ -14,12 +14,12 @@ int main(){ //sp float spvals1[size]={-1e30f,-1e19f,-300.f,-20.f,-0.23f,0.f,13.f,230.f,1e20f,1e30f}; float spvals2[size]={1e2f,1e1f,400.f,20.f,0.934f,0.f,-21.2f,-532.f,-1e17f,-1e29f}; - printFuncDiff("atan2f", (spsp2function)atan2f,(spsp2function)fast_atan2f,spvals1,spvals2,size); + printFuncDiff("atan2f", (spsp2function)refMath::atan2f,(spsp2function)fast_atan2f,spvals1,spvals2,size); //sp double dpvals1[size]={-1e30,-1e19,-300.,-20.,-0.23,0.f,13.,230.,1e20,1e90}; double dpvals2[size]={1e2,1e1,400.,20.,0.934,0.,-21.2,-532.,-1e17,-1e29}; - printFuncDiff("atan2", (dpdp2function)atan2,(dpdp2function)fast_atan2,dpvals1,dpvals2,size); + printFuncDiff("atan2", (dpdp2function)refMath::atan2,(dpdp2function)fast_atan2,dpvals1,dpvals2,size); } diff --git a/progs/units/atan_test.cpp b/progs/units/atan_test.cpp index 29d700c..ed5cdea 100644 --- a/progs/units/atan_test.cpp +++ b/progs/units/atan_test.cpp @@ -19,12 +19,12 @@ int main(){ // dp double dpvals[size]={-1e200,-1e50,-300.,-20.,0.,13.,230.,1e20,1e303}; - printFuncDiff("atan", (dpdpfunction)atan,(dpdpfunction)fast_atan,dpvals,size); + printFuncDiff("atan", (dpdpfunction)refMath::atan,(dpdpfunction)fast_atan,dpvals,size); printFuncDiff ("atanv", (dpdpfunctionv) atanv, (dpdpfunctionv) fast_atanv, dpvals, size ); //sp float spvals[size]={-1e30f,-1e19f,-300.f,-20.f,0.f,13.f,230.f,1e20f,1e30f}; - printFuncDiff("atanf", (spspfunction)atanf,(spspfunction)fast_atanf,spvals,size); + printFuncDiff("atanf", (spspfunction)refMath::atanf,(spspfunction)fast_atanf,spvals,size); printFuncDiff ("atanfv", (spspfunctionv) atanfv, (spspfunctionv) fast_atanfv, spvals, size ); } diff --git a/progs/units/cos_test.cpp b/progs/units/cos_test.cpp index 535e0e0..755273b 100644 --- a/progs/units/cos_test.cpp +++ b/progs/units/cos_test.cpp @@ -21,13 +21,13 @@ int main(){ // dp double dpvals[size]={32.*PI,5.6*PI,PI/4.1,PI/6.2,PI/7,PI/7.5,PI/85,PI/19,PI/10,0.000001}; - printFuncDiff("cos", (dpdpfunction)cos,(dpdpfunction)fast_cos,dpvals,size); + printFuncDiff("cos", (dpdpfunction)refMath::cos,(dpdpfunction)fast_cos,dpvals,size); printFuncDiff ("cosv", (dpdpfunctionv) cosv, (dpdpfunctionv) fast_cosv, dpvals, size ); // printFuncDiff("cos2", (dpdpfunction)cos,(dpdpfunction)fast_cos2,dpvals,size); //sp float spvals[size]={PI,PI/2.9,PI/4.1,PI/6.2,PI/7,PI/7,PI/85,PI/19,PI/10,PI/20.2}; - printFuncDiff("cosf", (spspfunction)cosf,(spspfunction)fast_cosf,spvals,size); + printFuncDiff("cosf", (spspfunction)refMath::cosf,(spspfunction)fast_cosf,spvals,size); printFuncDiff ("cosfv", (spspfunctionv) cosfv, (spspfunctionv) fast_cosfv, spvals, size ); } diff --git a/progs/units/exp_test.cpp b/progs/units/exp_test.cpp index 4e54837..d2d7b07 100644 --- a/progs/units/exp_test.cpp +++ b/progs/units/exp_test.cpp @@ -19,12 +19,12 @@ int main(){ // dp double dpvals[size]={-705,-100,-2,-1e-16,0,1e-50,4,10,500,805}; - printFuncDiff("exp", (dpdpfunction)exp,(dpdpfunction)fast_exp,dpvals,size); + printFuncDiff("exp", (dpdpfunction)refMath::exp,(dpdpfunction)fast_exp,dpvals,size); printFuncDiff ("expv", (dpdpfunctionv) expv, (dpdpfunctionv) fast_expv, dpvals, size ); //sp float spvals[size]={-87.f,-50.f,-2.f,-1e-10f,0.f,1e-10f,4.f,10.f,50.f,95.f}; - printFuncDiff("expf", (spspfunction)expf,(spspfunction)fast_expf,spvals,size); + printFuncDiff("expf", (spspfunction)refMath::expf,(spspfunction)fast_expf,spvals,size); printFuncDiff ("expvf", (spspfunctionv) expfv, (spspfunctionv) fast_expfv, spvals, size ); diff --git a/progs/units/log_test.cpp b/progs/units/log_test.cpp index c0e717f..4fb58e4 100644 --- a/progs/units/log_test.cpp +++ b/progs/units/log_test.cpp @@ -19,12 +19,12 @@ int main(){ // dp double dpvals[size]={1e200,1.34e101,2,1e-16,0,1e-50,4,10,500,.1}; - printFuncDiff("log", (dpdpfunction)log,(dpdpfunction)fast_log,dpvals,size); + printFuncDiff("log", (dpdpfunction)refMath::log,(dpdpfunction)fast_log,dpvals,size); printFuncDiff ("logv", (dpdpfunctionv) logv, (dpdpfunctionv) fast_logv, dpvals, size ); //sp float spvals[size]={-87.f,-50.f,-2.f,-1e-1f,0.f,1e-5f,4.f,10.f,50.f,95.f}; - printFuncDiff("logf", (spspfunction)logf,(spspfunction)fast_logf,spvals,size); + printFuncDiff("logf", (spspfunction)refMath::logf,(spspfunction)fast_logf,spvals,size); printFuncDiff ("logvf", (spspfunctionv) logfv, (spspfunctionv) fast_logfv, spvals, size ); } diff --git a/progs/units/sin_test.cpp b/progs/units/sin_test.cpp index bb75d7b..3666c3a 100644 --- a/progs/units/sin_test.cpp +++ b/progs/units/sin_test.cpp @@ -21,13 +21,13 @@ int main(){ // dp double dpvals[size]={PI,PI/2.9,PI/4.1,PI/6.2,PI/7,PI/7,PI/85,PI/19,PI/10,PI/20.2}; - printFuncDiff("sin", (dpdpfunction)sin,(dpdpfunction)fast_sin,dpvals,size); + printFuncDiff("sin", (dpdpfunction)refMath::sin,(dpdpfunction)fast_sin,dpvals,size); printFuncDiff ("sinv", (dpdpfunctionv) sinv, (dpdpfunctionv) fast_sinv, dpvals, size ); //sp float spvals[size]={PI,PI/2.9,PI/4.1,PI/6.2,PI/7,PI/7,PI/85,PI/19,PI/10,PI/20.2}; - printFuncDiff("sinf", (spspfunction)sinf,(spspfunction)fast_sinf,spvals,size); + printFuncDiff("sinf", (spspfunction)refMath::sinf,(spspfunction)fast_sinf,spvals,size); printFuncDiff ("sinfv", (spspfunctionv) sinfv, (spspfunctionv) fast_sinfv, spvals, size ); diff --git a/progs/units/tan_test.cpp b/progs/units/tan_test.cpp index c98d217..7e85fee 100644 --- a/progs/units/tan_test.cpp +++ b/progs/units/tan_test.cpp @@ -21,12 +21,12 @@ int main(){ // dp double dpvals[size]={0.01, 0.1+PI/4, 0.01+PI/2, 1176.2*PI,0,-PI/7.5,PI/85,-PI/19,PI/10,-0.000001}; - printFuncDiff("tan", (dpdpfunction)tan,(dpdpfunction)fast_tan,dpvals,size); + printFuncDiff("tan", (dpdpfunction)refMath::tan,(dpdpfunction)fast_tan,dpvals,size); printFuncDiff ("tanv", (dpdpfunctionv) tanv, (dpdpfunctionv) fast_tanv, dpvals, size ); //sp float spvals[size]={0.01, 0.1+PI/4, 0.01+PI/2, 1176.2*PI,PI/7,-PI/7.5,PI/85,-PI/19,PI/10,-0.000001}; - printFuncDiff("tanf", (spspfunction)tanf,(spspfunction)fast_tanf,spvals,size); + printFuncDiff("tanf", (spspfunction)refMath::tanf,(spspfunction)fast_tanf,spvals,size); printFuncDiff ("tanfv", (spspfunctionv) tanfv, (spspfunctionv) fast_tanfv, spvals, size ); } diff --git a/progs/units/tanh_test.cpp b/progs/units/tanh_test.cpp index 28300e2..7e14d48 100644 --- a/progs/units/tanh_test.cpp +++ b/progs/units/tanh_test.cpp @@ -19,12 +19,12 @@ int main(){ // dp double dpvals[size]={-1e200,-1e50,-10.,-0.1,0.,0.3,2.3,1e20,1e303}; - printFuncDiff("tanh", (dpdpfunction)tanh,(dpdpfunction)fast_tanh,dpvals,size); + printFuncDiff("tanh", (dpdpfunction)refMath::tanh,(dpdpfunction)fast_tanh,dpvals,size); printFuncDiff ("tanhv", (dpdpfunctionv) tanhv, (dpdpfunctionv) fast_tanhv, dpvals, size ); //sp float spvals[size]={-1e30f,-1e1f,-3.f,-0.7f,0.f,.3f,2.3f,1e20f,1e30f}; - printFuncDiff("tanhf", (spspfunction)tanhf,(spspfunction)fast_tanhf,spvals,size); + printFuncDiff("tanhf", (spspfunction)refMath::tanhf,(spspfunction)fast_tanhf,spvals,size); printFuncDiff ("tanhfv", (spspfunctionv) tanhfv, (spspfunctionv) fast_tanhfv, spvals, size ); } diff --git a/progs/units/test_fcnComparison.cpp b/progs/units/test_fcnComparison.cpp index 793b99e..ec7ba2e 100644 --- a/progs/units/test_fcnComparison.cpp +++ b/progs/units/test_fcnComparison.cpp @@ -21,7 +21,7 @@ int main(){ // Test the FcnResponse in double precision std::string dpofilename("test_dpfunctionComparison.txt"); randomPool dpRandomPool(100,1000,size); - fcnResponse dpLogResp("Log",dpRandomPool.getNumbers(), (vdth::dpdpfunction) log); + fcnResponse dpLogResp("Log",dpRandomPool.getNumbers(), (vdth::dpdpfunction) refMath::log); fcnResponse dpFastLogResp("Fast Log",dpRandomPool.getNumbers(), (vdth::dpdpfunction) vdt::fast_log); fcnComparison dpLogComp("Log - libmVSvdt", dpRandomPool.getNumbers(), @@ -37,7 +37,7 @@ int main(){ // Test the FcnResponse in single precision std::string spofilename("test_spfunctionComparison.txt"); randomPool spRandomPool(1,1000,size); - fcnResponse spLogResp("Logf",spRandomPool.getNumbers(), (vdth::spspfunction) logf); + fcnResponse spLogResp("Logf",spRandomPool.getNumbers(), (vdth::spspfunction) refMath::logf); fcnResponse spFastLogResp("Fast Logf",spRandomPool.getNumbers(), (vdth::spspfunction) vdt::fast_logf); fcnComparison spLogComp("Logf - libmVSvdt", spRandomPool.getNumbers(), diff --git a/progs/units/test_fcnPerformance.cpp b/progs/units/test_fcnPerformance.cpp index 6cb53b9..601658b 100644 --- a/progs/units/test_fcnPerformance.cpp +++ b/progs/units/test_fcnPerformance.cpp @@ -24,7 +24,7 @@ int main(){ // Test the FcnResponse in double precision fcnPerformance dpExpPerf("Exp", dpRandomPool.getNumbers(), - (vdth::dpdpfunction) exp,repetitions); + (vdth::dpdpfunction) refMath::exp,repetitions); dpExpPerf.print(); fcnPerformance dpFastExpPerf("Fast Exp", diff --git a/progs/units/test_fcnResponse.cpp b/progs/units/test_fcnResponse.cpp index ae060ae..9644549 100644 --- a/progs/units/test_fcnResponse.cpp +++ b/progs/units/test_fcnResponse.cpp @@ -20,7 +20,7 @@ int main(){ // Test the FcnResponse in double precision const std::string dpfilename("testDpFcnPerf.txt"); randomPool dpRandomPool(-500,500,size); - fcnResponse dpExpResp("Exp",dpRandomPool.getNumbers(), (vdth::dpdpfunction) exp); + fcnResponse dpExpResp("Exp",dpRandomPool.getNumbers(), (vdth::dpdpfunction) refMath::exp); dpExpResp.writeFile(dpfilename); fcnResponse dpExpRespFromFile(dpfilename); dpExpRespFromFile.print(); @@ -29,7 +29,7 @@ int main(){ // Test the FcnResponse in single precision const std::string spfilename("testSpFcnPerf.txt"); randomPool spRandomPool(-50,50,size); - fcnResponse spExpResp("Exp",spRandomPool.getNumbers(), (vdth::spspfunction) expf); + fcnResponse spExpResp("Exp",spRandomPool.getNumbers(), (vdth::spspfunction) refMath::expf); spExpResp.writeFile(spfilename); fcnResponse spExpRespFromFile(spfilename); spExpRespFromFile.print(); @@ -43,7 +43,7 @@ int main(){ fcnResponse2D dpAtan2Resp("Atan2", dp2RandomPool.getNumbersX(), dp2RandomPool.getNumbersY(), - (vdth::dpdp2function) atan2); + (vdth::dpdp2function) refMath::atan2); dpAtan2Resp.print(); dpAtan2Resp.writeFile(dp2filename); @@ -57,7 +57,7 @@ int main(){ fcnResponse2D spAtan2Resp("Atan2", sp2RandomPool.getNumbersX(), sp2RandomPool.getNumbersY(), - (vdth::spsp2function) atan2); + (vdth::spsp2function) refMath::atan2); spAtan2Resp.print(); spAtan2Resp.writeFile(sp2filename); diff --git a/progs/vdtArithmBenchmark.cpp b/progs/vdtArithmBenchmark.cpp index 0ae164b..2259698 100644 --- a/progs/vdtArithmBenchmark.cpp +++ b/progs/vdtArithmBenchmark.cpp @@ -131,7 +131,7 @@ int main(int argc, char **argv){ // Add atan2 std::cout << " - Processing atan2 (all flavours)\n"; saveResponses2D ("Atan2", - atan2, + refMath::atan2, spool2D->getNumbersX(),spool2D->getNumbersY(), nick); saveResponses2D ("Fast_Atan2", @@ -192,7 +192,7 @@ int main(int argc, char **argv){ // Add atan2 std::cout << " - Processing atan2 (all flavours)\n"; saveResponses2D ("Atan2f", - atan2f, + refMath::atan2f, fspool2D->getNumbersX(),fspool2D->getNumbersY(), nick); saveResponses2D ("Fast_Atan2f", diff --git a/progs/vdtArithmComparison.cpp b/progs/vdtArithmComparison.cpp index 6008380..c250f2d 100644 --- a/progs/vdtArithmComparison.cpp +++ b/progs/vdtArithmComparison.cpp @@ -17,11 +17,10 @@ #include "vdtdiag_fcnComparison.h" #include "vdtdiag_simpleCmd.h" - //converts (comma) separated list (in string) to vector of strings void list2vector(std::string csList, std::vector* vect, char separator = ','){ int lastCommaPos = -1, commaPos; - + vect->clear(); while(true){ //no other comma, break