|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r75999 - sandbox/math_constants/libs/math/test
From: pbristow_at_[hidden]
Date: 2011-12-16 13:07:30
Author: pbristow
Date: 2011-12-16 13:07:29 EST (Fri, 16 Dec 2011)
New Revision: 75999
URL: http://svn.boost.org/trac/boost/changeset/75999
Log:
Removed some duplicates and unwanted cf10.
(Matching calculate_constants, and updated constants.hpp)
Text files modified:
sandbox/math_constants/libs/math/test/test_constant_generate.cpp | 196 +++++++++++++++++++++++++++++++++++++--
1 files changed, 185 insertions(+), 11 deletions(-)
Modified: sandbox/math_constants/libs/math/test/test_constant_generate.cpp
==============================================================================
--- sandbox/math_constants/libs/math/test/test_constant_generate.cpp (original)
+++ sandbox/math_constants/libs/math/test/test_constant_generate.cpp 2011-12-16 13:07:29 EST (Fri, 16 Dec 2011)
@@ -5,31 +5,205 @@
// (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifdef _MSC_VER
+# pragma warning (disable : 4127) // conditional expression is constant.
+# pragma warning (disable : 4512) // assignment operator could not be generated.
+# pragma warning (disable : 4100) // assignment operator could not be generated.
+# pragma warning (disable : 4996) //To disable this warning, use -D_SCL_SECURE_NO_WARNINGS.
+#endif
+
+// To add new constants, add a function that calculates the value of the constant to
+// boost/math/constants/calculate_constants.hpp
+
#include <boost/math/constants/generate.hpp>
+#include <boost/math/constants/calculate_constants.hpp>
int main()
{
+ // Rational fractions.
+ BOOST_CONSTANTS_GENERATE(half);
+ BOOST_CONSTANTS_GENERATE(third);
+ BOOST_CONSTANTS_GENERATE(twothirds);
+ BOOST_CONSTANTS_GENERATE(two_thirds);
+ BOOST_CONSTANTS_GENERATE(three_quarters);
+ // two and related.
+ BOOST_CONSTANTS_GENERATE(root_two);
+ BOOST_CONSTANTS_GENERATE(root_three);
+ BOOST_CONSTANTS_GENERATE(half_root_two);
+ BOOST_CONSTANTS_GENERATE(ln_two);
+ BOOST_CONSTANTS_GENERATE(ln_ln_two);
+ BOOST_CONSTANTS_GENERATE(root_ln_four);
+ BOOST_CONSTANTS_GENERATE(one_div_root_two);
+ // pi and related.
BOOST_CONSTANTS_GENERATE(pi);
+ BOOST_CONSTANTS_GENERATE(half_pi);
+ BOOST_CONSTANTS_GENERATE(third_pi);
+ BOOST_CONSTANTS_GENERATE(sixth_pi);
BOOST_CONSTANTS_GENERATE(two_pi);
+ BOOST_CONSTANTS_GENERATE(two_thirds_pi);
+ BOOST_CONSTANTS_GENERATE(three_quarters_pi);
+ BOOST_CONSTANTS_GENERATE(four_thirds_pi);
BOOST_CONSTANTS_GENERATE(one_div_two_pi);
+ BOOST_CONSTANTS_GENERATE(one_div_root_two_pi);
BOOST_CONSTANTS_GENERATE(root_pi);
BOOST_CONSTANTS_GENERATE(root_half_pi);
BOOST_CONSTANTS_GENERATE(root_two_pi);
- BOOST_CONSTANTS_GENERATE(root_ln_four);
- BOOST_CONSTANTS_GENERATE(e);
- BOOST_CONSTANTS_GENERATE(euler);
- BOOST_CONSTANTS_GENERATE(root_two);
- BOOST_CONSTANTS_GENERATE(half_root_two);
- BOOST_CONSTANTS_GENERATE(ln_two);
- BOOST_CONSTANTS_GENERATE(ln_ln_two);
- BOOST_CONSTANTS_GENERATE(third);
- BOOST_CONSTANTS_GENERATE(twothirds);
+
+ BOOST_CONSTANTS_GENERATE(one_div_root_pi);
+ BOOST_CONSTANTS_GENERATE(root_one_div_pi);
BOOST_CONSTANTS_GENERATE(pi_minus_three);
BOOST_CONSTANTS_GENERATE(four_minus_pi);
BOOST_CONSTANTS_GENERATE(pow23_four_minus_pi);
+
+ BOOST_CONSTANTS_GENERATE(pi_pow_e);
+ BOOST_CONSTANTS_GENERATE(pi_sqr);
+ BOOST_CONSTANTS_GENERATE(pi_sqr_div_six);
+ BOOST_CONSTANTS_GENERATE(pi_cubed);
+ BOOST_CONSTANTS_GENERATE(cbrt_pi);
+ BOOST_CONSTANTS_GENERATE(one_div_cbrt_pi);
+
+ // Euler's e and related.
+ BOOST_CONSTANTS_GENERATE(e);
+ BOOST_CONSTANTS_GENERATE(euler);
BOOST_CONSTANTS_GENERATE(exp_minus_half);
- BOOST_CONSTANTS_GENERATE(one_div_root_two);
- BOOST_CONSTANTS_GENERATE(one_div_root_two_pi);
+
+ BOOST_CONSTANTS_GENERATE(e_pow_pi);
+ BOOST_CONSTANTS_GENERATE(root_e);
+ BOOST_CONSTANTS_GENERATE(log10_e);
+ BOOST_CONSTANTS_GENERATE(one_div_log10_e);
+
+ // Trigonometric
+ BOOST_CONSTANTS_GENERATE(degree);
+ BOOST_CONSTANTS_GENERATE(radian);
+ BOOST_CONSTANTS_GENERATE(sin_one);
+ BOOST_CONSTANTS_GENERATE(cos_one);
+ BOOST_CONSTANTS_GENERATE(sinh_one);
+ BOOST_CONSTANTS_GENERATE(cosh_one);
+
+ // Phi
+ BOOST_CONSTANTS_GENERATE(phi);
+ BOOST_CONSTANTS_GENERATE(log_phi);
+ BOOST_CONSTANTS_GENERATE(one_div_log_phi);
+
+// Euler's Gamma constant http://en.wikipedia.org/wiki/Euler%E2%80%93Mascheroni_constant
+ BOOST_CONSTANTS_GENERATE(gamma);
+ BOOST_CONSTANTS_GENERATE(one_div_gamma);
+ BOOST_CONSTANTS_GENERATE(gamma_sqr);
+
+// zeta
+ BOOST_CONSTANTS_GENERATE(zeta_two);
+ BOOST_CONSTANTS_GENERATE(zeta_three);
+ BOOST_CONSTANTS_GENERATE(catalan);
+ BOOST_CONSTANTS_GENERATE(khinchin);
+ BOOST_CONSTANTS_GENERATE(glaisher);
+ BOOST_CONSTANTS_GENERATE(extreme_value_skewness);
+ BOOST_CONSTANTS_GENERATE(rayleigh_skewness);
+ BOOST_CONSTANTS_GENERATE(rayleigh_kurtosis);
+ BOOST_CONSTANTS_GENERATE(rayleigh_kurtosis_excess);
+
+
return 0;
}
+/*
+
+Output
+
+ test_constant_generate.cpp
+ test_constant_generate.vcxproj -> J:\Cpp\math_constants\Debug\test_constant_generate.exe
+ BOOST_DEFINE_MATH_CONSTANT(pi, 3.141592653589793238462643383279502884, 1971693993751058209749445923078164062862089986280348253421170679821480865, 0);
+ BOOST_DEFINE_MATH_CONSTANT(two_pi, 6.283185307179586476925286766559005768, 394338798750211641949889184615632812572417997256069650684234135964296173, 0);
+ BOOST_DEFINE_MATH_CONSTANT(one_div_two_pi, 1.591549430918953357688837633725143620, 3445964574045644874766734405889679763422653509011380276625308595607284273, -1);
+ BOOST_DEFINE_MATH_CONSTANT(root_pi, 1.772453850905516027298167483341145182, 7975494561223871282138077898529112845910321813749506567385446654162268236, 0);
+ BOOST_DEFINE_MATH_CONSTANT(root_half_pi, 1.253314137315500251207882642405522626, 5034933703049691583149617881711468273039209874732979191890286330580049863, 0);
+ BOOST_DEFINE_MATH_CONSTANT(root_two_pi, 2.506628274631000502415765284811045253, 0069867406099383166299235763422936546078419749465958383780572661160099727, 0);
+ BOOST_DEFINE_MATH_CONSTANT(root_ln_four, 1.177410022515474691011569326459699637, 7473856893858205385225257565000265885469849268084181383687708110674715786, 0);
+ BOOST_DEFINE_MATH_CONSTANT(e, 2.718281828459045235360287471352662497, 7572470936999595749669676277240766303535475945713821785251664274274663919, 0);
+ BOOST_DEFINE_MATH_CONSTANT(euler, 5.772156649015328606065120900824024310, 4215933593992359880576723488486772677766467093694706329174674951463144725, -1);
+ BOOST_DEFINE_MATH_CONSTANT(root_two, 1.414213562373095048801688724209698078, 5696718753769480731766797379907324784621070388503875343276415727350138462, 0);
+ BOOST_DEFINE_MATH_CONSTANT(half_root_two, 7.071067811865475244008443621048490392, 8483593768847403658833986899536623923105351942519376716382078636750692312, -1);
+ BOOST_DEFINE_MATH_CONSTANT(ln_two, 6.931471805599453094172321214581765680, 7550013436025525412068000949339362196969471560586332699641868754200148102, -1);
+ BOOST_DEFINE_MATH_CONSTANT(ln_ln_two, -3.665129205816643270124391582326694694, 5426344783710526305367771367056161531935273854945582285669890835830252305, -1);
+ BOOST_DEFINE_MATH_CONSTANT(third, 3.333333333333333333333333333333333333, 3333333333333333333333333333333333333333333333333333333333333333333333333, -1);
+ BOOST_DEFINE_MATH_CONSTANT(twothirds, 6.666666666666666666666666666666666666, 6666666666666666666666666666666666666666666666666666666666666666666666667, -1);
+ BOOST_DEFINE_MATH_CONSTANT(pi_minus_three, 1.415926535897932384626433832795028841, 9716939937510582097494459230781640628620899862803482534211706798214808651, -1);
+ BOOST_DEFINE_MATH_CONSTANT(four_minus_pi, 8.584073464102067615373566167204971158, 0283060062489417902505540769218359371379100137196517465788293201785191349, -1);
+ BOOST_DEFINE_MATH_CONSTANT(pow23_four_minus_pi, 7.953167673715975443483953350568065807, 2763917332771320544530223438885626826751818759075800688860082843683980018, -1);
+ BOOST_DEFINE_MATH_CONSTANT(exp_minus_half, 6.065306597126334236037995349911804534, 4191813548718695568289215873505651941374842399864761150798945602642378979, -1);
+ BOOST_DEFINE_MATH_CONSTANT(one_div_root_two, 7.071067811865475244008443621048490392, 8483593768847403658833986899536623923105351942519376716382078636750692312, -1);
+ BOOST_DEFINE_MATH_CONSTANT(one_div_root_two_pi, 3.989422804014326779399460599343818684, 7585863116493465766592582967065792589930183850125233390730693643030255886, -1);
+========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
+
+1> BOOST_DEFINE_MATH_CONSTANT(half, 5.000000000000000000000000000000000000, 00000000000000000000000000000000000000000000000000000000000000000000000000, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(third, 3.333333333333333333333333333333333333, 33333333333333333333333333333333333333333333333333333333333333333333333333, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(twothirds, 6.666666666666666666666666666666666666, 66666666666666666666666666666666666666666666666666666666666666666666666667, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(two_thirds, 6.666666666666666666666666666666666666, 66666666666666666666666666666666666666666666666666666666666666666666666667, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(three_quarters, 7.500000000000000000000000000000000000, 00000000000000000000000000000000000000000000000000000000000000000000000000, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(root_two, 1.414213562373095048801688724209698078, 56967187537694807317667973799073247846210703885038753432764157273501384623, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(root_three, 1.732050807568877293527446341505872366, 94280525381038062805580697945193301690880003708114618675724857567562614142, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(half_root_two, 7.071067811865475244008443621048490392, 84835937688474036588339868995366239231053519425193767163820786367506923115, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(ln_two, 6.931471805599453094172321214581765680, 75500134360255254120680009493393621969694715605863326996418687542001481021, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(ln_ln_two, -3.665129205816643270124391582326694694, 54263447837105263053677713670561615319352738549455822856698908358302523045, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(root_ln_four, 1.177410022515474691011569326459699637, 74738568938582053852252575650002658854698492680841813836877081106747157858, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(one_div_root_two, 7.071067811865475244008443621048490392, 84835937688474036588339868995366239231053519425193767163820786367506923115, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(pi, 3.141592653589793238462643383279502884, 19716939937510582097494459230781640628620899862803482534211706798214808651, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(half_pi, 1.570796326794896619231321691639751442, 09858469968755291048747229615390820314310449931401741267105853399107404326, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(third_pi, 1.047197551196597746154214461093167628, 06572313312503527365831486410260546876206966620934494178070568932738269550, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(sixth_pi, 5.235987755982988730771072305465838140, 32861566562517636829157432051302734381034833104672470890352844663691347752, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(two_pi, 6.283185307179586476925286766559005768, 39433879875021164194988918461563281257241799725606965068423413596429617303, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(two_thirds_pi, 2.094395102393195492308428922186335256, 13144626625007054731662972820521093752413933241868988356141137865476539101, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(three_quarters_pi, 2.356194490192344928846982537459627163, 14787704953132936573120844423086230471465674897102611900658780098661106488, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(four_thirds_pi, 4.188790204786390984616857844372670512, 26289253250014109463325945641042187504827866483737976712282275730953078202, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(one_div_two_pi, 1.591549430918953357688837633725143620, 34459645740456448747667344058896797634226535090113802766253085956072842727, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(one_div_root_two_pi, 3.989422804014326779399460599343818684, 75858631164934657665925829670657925899301838501252333907306936430302558863, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(root_pi, 1.772453850905516027298167483341145182, 79754945612238712821380778985291128459103218137495065673854466541622682362, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(root_half_pi, 1.253314137315500251207882642405522626, 50349337030496915831496178817114682730392098747329791918902863305800498633, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(root_two_pi, 2.506628274631000502415765284811045253, 00698674060993831662992357634229365460784197494659583837805726611600997267, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(one_div_root_pi, 5.641895835477562869480794515607725858, 44050629328998856844085721710642468441493414486743660202107363443028347906, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(root_one_div_pi, 5.641895835477562869480794515607725858, 44050629328998856844085721710642468441493414486743660202107363443028347906, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(pi_minus_three, 1.415926535897932384626433832795028841, 97169399375105820974944592307816406286208998628034825342117067982148086513, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(four_minus_pi, 8.584073464102067615373566167204971158, 02830600624894179025055407692183593713791001371965174657882932017851913487, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(pow23_four_minus_pi, 7.953167673715975443483953350568065807, 27639173327713205445302234388856268267518187590758006888600828436839800178, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(pi_pow_e, 2.245915771836104547342715220454373502, 75893151339966922492030025540669260403991179123185197527271430315314500731, +01);
+1> BOOST_DEFINE_MATH_CONSTANT(pi_sqr, 9.869604401089358618834490999876151135, 31369940724079062641334937622004482241920524300177340371855223182402591377, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(pi_sqr_div_six, 1.644934066848226436472415166646025189, 21894990120679843773555822937000747040320087383362890061975870530400431896, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(pi_cubed, 3.100627668029982017547631506710139520, 22252885658851076941445381038063949174657060375667010326028861930301219616, +01);
+1> BOOST_DEFINE_MATH_CONSTANT(cbrt_pi, 3.225153443319948918442205268856368859, 30633361474780767345817222155840617944954895382254148095655200372649757346, -02);
+1> BOOST_DEFINE_MATH_CONSTANT(one_div_cbrt_pi, 3.100627668029982017547631506710139520, 22252885658851076941445381038063949174657060375667010326028861930301219616, +01);
+1> BOOST_DEFINE_MATH_CONSTANT(e, 2.718281828459045235360287471352662497, 75724709369995957496696762772407663035354759457138217852516642742746639193, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(euler, 5.772156649015328606065120900824024310, 42159335939923598805767234884867726777664670936947063291746749514631447250, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(exp_minus_half, 6.065306597126334236037995349911804534, 41918135487186955682892158735056519413748423998647611507989456026423789794, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(e_pow_pi, 2.314069263277926900572908636794854738, 02661062426002119934450464095243423506904527835169719970675492196759527048, +01);
+1> BOOST_DEFINE_MATH_CONSTANT(root_e, 1.648721270700128146848650787814163571, 65377610071014801157507931164066102119421560863277652005636664300286663776, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(log10_e, 4.342944819032518276511289189166050822, 94397005803666566114453783165864649208870774729224949338431748318706106745, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(one_div_log10_e, 2.302585092994045684017991454684364207, 60110148862877297603332790096757260967735248023599720508959829834196778404, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(degree, 1.745329251994329576923690768488612713, 44287188854172545609719144017100911460344944368224156963450948221230449251, -02);
+1> BOOST_DEFINE_MATH_CONSTANT(radian, 5.729577951308232087679815481410517033, 24054724665643215491602438612028471483215526324409689958511109441862233816, +01);
+1> BOOST_DEFINE_MATH_CONSTANT(sin_one, 8.414709848078965066525023216302989996, 22563060798371065672751709991910404391239668948639743543052695854349037908, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(cos_one, 5.403023058681397174009366074429766037, 32310420617922227670097255381100394774471764517951856087183089343571731160, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(sinh_one, 1.175201193643801456882381850595600815, 15571798133409587022956541301330756730432389560711745208962339184041953333, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(cosh_one, 1.543080634815243778477905620757061682, 60152911236586370473740221471076906304922369896426472643554303558704685860, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(phi, 1.618033988749894848204586834365638117, 72030917980576286213544862270526046281890244970720720418939113748475408808, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(log_phi, 4.812118250596034474977589134243684231, 35184334385660519661018168840163867608221774412009429122723474997231839958, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(one_div_log_phi, 2.078086921235027537601322606117795767, 74219226778328348027813992191974386928553540901445615414453604821933918634, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(gamma, 5.772156649015328606065120900824024310, 42159335939923598805767234884867726777664670936947063291746749514631447250, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(one_div_gamma, 1.732454714600633473583025315860829681, 15577655226680502204843613287065531408655243008832840219409928068072365714, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(gamma_sqr, 3.331779238077186743183761363552442266, 59417140249629743150833338002265793695756669661263268631715977303039565603, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(zeta_two, 1.644934066848226436472415166646025189, 21894990120679843773555822937000747040320087383362890061975870530400431896, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(zeta_three, 1.202056903159594285399738161511449990, 76498629234049888179227155534183820578631309018645587360933525814619915780, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(catalan, 9.159655941772190150546035149323841107, 74149374281672134266498119621763019776254769479356512926115106248574422619, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(khinchin, 2.685452001065306445309714835481795693, 82038229399446295305115234555721885953715200280114117493184769799515346591, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(glaisher, 1.282427129100622636875342568869791727, 76768892732500119206374002174040630885882646112973649195820237439420646120, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(extreme_value_skewness, 1.139547099404648657492793019389846112, 08759979583655182472165571008524800770607068570718754688693851501894272049, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(rayleigh_skewness, 6.311106578189371381918993515442277798, 44042203134719497658094585692926819617473725459905027032537306794400047264, -01);
+1> BOOST_DEFINE_MATH_CONSTANT(rayleigh_kurtosis, 3.245089300687638062848660410619754415, 41706673178920936177133764493367904540874159051490619368679348977426462633, +00);
+1> BOOST_DEFINE_MATH_CONSTANT(rayleigh_kurtosis_excess, 2.450893006876380628486604106197544154, 17066731789209361771337644933679045408741590514906193686793489774264626328, -01);
+
+
+
+
+
+
+*/
+
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk