diff --git a/dynare++/integ/cc/precalc_quadrature.hh b/dynare++/integ/cc/precalc_quadrature.hh index f997e0f178cc5422b980e3d1c409daff2fd0ca15..1aa3f04bd50a7603ffe93f4ca54e7844f618c1c8 100644 --- a/dynare++/integ/cc/precalc_quadrature.hh +++ b/dynare++/integ/cc/precalc_quadrature.hh @@ -29,1042 +29,1045 @@ static const int gh_num_levels = 26; // Number of points in each level -static const int gh_num_points[] = { - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 30, 32, 40, 50, 60, 64 -}; +static const int gh_num_points[] = + { + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 30, 32, 40, 50, 60, 64 + }; // Weights, starting with the first level -static const double gh_weights[] = { - // weights 1 = √π - 1.77245385090551588191942755656782537698745727539062, - // weights 2 - 0.886226925452758013649083741671e+00, - 0.886226925452758013649083741671e+00, - // weights 3 - 0.295408975150919337883027913890e+00, - 0.118163590060367735153211165556e+01, - 0.295408975150919337883027913890e+00, - // weights 4 - 0.813128354472451771430345571899e-01, - 0.804914090005512836506049184481e+00, - 0.804914090005512836506049184481e+00, - 0.813128354472451771430345571899e-01, - // weights 5 - 0.199532420590459132077434585942e-01, - 0.393619323152241159828495620852e+00, - 0.945308720482941881225689324449e+00, - 0.393619323152241159828495620852e+00, - 0.199532420590459132077434585942e-01, - // weights 6 - 0.453000990550884564085747256463e-02, - 0.157067320322856643916311563508e+00, - 0.724629595224392524091914705598e+00, - 0.724629595224392524091914705598e+00, - 0.157067320322856643916311563508e+00, - 0.453000990550884564085747256463e-02, - // weights 7 - 0.971781245099519154149424255939e-03, - 0.545155828191270305921785688417e-01, - 0.425607252610127800520317466666e+00, - 0.810264617556807326764876563813e+00, - 0.425607252610127800520317466666e+00, - 0.545155828191270305921785688417e-01, - 0.971781245099519154149424255939e-03, - // weights 8 - 0.199604072211367619206090452544e-03, - 0.170779830074134754562030564364e-01, - 0.207802325814891879543258620286e+00, - 0.661147012558241291030415974496e+00, - 0.661147012558241291030415974496e+00, - 0.207802325814891879543258620286e+00, - 0.170779830074134754562030564364e-01, - 0.199604072211367619206090452544e-03, - // weights 9 - 0.396069772632643819045862946425e-04, - 0.494362427553694721722456597763e-02, - 0.884745273943765732879751147476e-01, - 0.432651559002555750199812112956e+00, - 0.720235215606050957124334723389e+00, - 0.432651559002555750199812112956e+00, - 0.884745273943765732879751147476e-01, - 0.494362427553694721722456597763e-02, - 0.396069772632643819045862946425e-04, - // weights 10 - 0.764043285523262062915936785960e-05, - 0.134364574678123269220156558585e-02, - 0.338743944554810631361647312776e-01, - 0.240138611082314686416523295006e+00, - 0.610862633735325798783564990433e+00, - 0.610862633735325798783564990433e+00, - 0.240138611082314686416523295006e+00, - 0.338743944554810631361647312776e-01, - 0.134364574678123269220156558585e-02, - 0.764043285523262062915936785960e-05, - // weights 11 - 0.143956039371425822033088366032e-05, - 0.346819466323345510643413772940e-03, - 0.119113954449115324503874202916e-01, - 0.117227875167708503381788649308e+00, - 0.429359752356125028446073598601e+00, - 0.654759286914591779203940657627e+00, - 0.429359752356125028446073598601e+00, - 0.117227875167708503381788649308e+00, - 0.119113954449115324503874202916e-01, - 0.346819466323345510643413772940e-03, - 0.143956039371425822033088366032e-05, - // weights 12 - 0.265855168435630160602311400877e-06, - 0.857368704358785865456906323153e-04, - 0.390539058462906185999438432620e-02, - 0.516079856158839299918734423606e-01, - 0.260492310264161129233396139765e+00, - 0.570135236262479578347113482275e+00, - 0.570135236262479578347113482275e+00, - 0.260492310264161129233396139765e+00, - 0.516079856158839299918734423606e-01, - 0.390539058462906185999438432620e-02, - 0.857368704358785865456906323153e-04, - 0.265855168435630160602311400877e-06, - // weights 13 - 0.482573185007313108834997332342e-07, - 0.204303604027070731248669432937e-04, - 0.120745999271938594730924899224e-02, - 0.208627752961699392166033805050e-01, - 0.140323320687023437762792268873e+00, - 0.421616296898543221746893558568e+00, - 0.604393187921161642342099068579e+00, - 0.421616296898543221746893558568e+00, - 0.140323320687023437762792268873e+00, - 0.208627752961699392166033805050e-01, - 0.120745999271938594730924899224e-02, - 0.204303604027070731248669432937e-04, - 0.482573185007313108834997332342e-07, - // weights 14 - 0.862859116812515794532041783429e-08, - 0.471648435501891674887688950105e-05, - 0.355092613551923610483661076691e-03, - 0.785005472645794431048644334608e-02, - 0.685055342234652055387163312367e-01, - 0.273105609064246603352569187026e+00, - 0.536405909712090149794921296776e+00, - 0.536405909712090149794921296776e+00, - 0.273105609064246603352569187026e+00, - 0.685055342234652055387163312367e-01, - 0.785005472645794431048644334608e-02, - 0.355092613551923610483661076691e-03, - 0.471648435501891674887688950105e-05, - 0.862859116812515794532041783429e-08, - // weights 15 - 0.152247580425351702016062666965e-08, - 0.105911554771106663577520791055e-05, - 0.100004441232499868127296736177e-03, - 0.277806884291277589607887049229e-02, - 0.307800338725460822286814158758e-01, - 0.158488915795935746883839384960e+00, - 0.412028687498898627025891079568e+00, - 0.564100308726417532852625797340e+00, - 0.412028687498898627025891079568e+00, - 0.158488915795935746883839384960e+00, - 0.307800338725460822286814158758e-01, - 0.277806884291277589607887049229e-02, - 0.100004441232499868127296736177e-03, - 0.105911554771106663577520791055e-05, - 0.152247580425351702016062666965e-08, - // weights 16 - 0.265480747401118224470926366050e-09, - 0.232098084486521065338749423185e-06, - 0.271186009253788151201891432244e-04, - 0.932284008624180529914277305537e-03, - 0.128803115355099736834642999312e-01, - 0.838100413989858294154207349001e-01, - 0.280647458528533675369463335380e+00, - 0.507929479016613741913517341791e+00, - 0.507929479016613741913517341791e+00, - 0.280647458528533675369463335380e+00, - 0.838100413989858294154207349001e-01, - 0.128803115355099736834642999312e-01, - 0.932284008624180529914277305537e-03, - 0.271186009253788151201891432244e-04, - 0.232098084486521065338749423185e-06, - 0.265480747401118224470926366050e-09, - // weights 17 - 0.458057893079863330580889281222e-10, - 0.497707898163079405227863353715e-07, - 0.711228914002130958353327376218e-05, - 0.298643286697753041151336643059e-03, - 0.506734995762753791170069495879e-02, - 0.409200341495762798094994877854e-01, - 0.172648297670097079217645196219e+00, - 0.401826469470411956577635085257e+00, - 0.530917937624863560331883103379e+00, - 0.401826469470411956577635085257e+00, - 0.172648297670097079217645196219e+00, - 0.409200341495762798094994877854e-01, - 0.506734995762753791170069495879e-02, - 0.298643286697753041151336643059e-03, - 0.711228914002130958353327376218e-05, - 0.497707898163079405227863353715e-07, - 0.458057893079863330580889281222e-10, - // weights 18 - 0.782819977211589102925147471012e-11, - 0.104672057957920824443559608435e-07, - 0.181065448109343040959702385911e-05, - 0.918112686792940352914675407371e-04, - 0.188852263026841789438175325426e-02, - 0.186400423875446519219315221973e-01, - 0.973017476413154293308537234155e-01, - 0.284807285669979578595606820713e+00, - 0.483495694725455552876410522141e+00, - 0.483495694725455552876410522141e+00, - 0.284807285669979578595606820713e+00, - 0.973017476413154293308537234155e-01, - 0.186400423875446519219315221973e-01, - 0.188852263026841789438175325426e-02, - 0.918112686792940352914675407371e-04, - 0.181065448109343040959702385911e-05, - 0.104672057957920824443559608435e-07, - 0.782819977211589102925147471012e-11, - // weights 19 - 0.132629709449851575185289154385e-11, - 0.216305100986355475019693077221e-08, - 0.448824314722312295179447915594e-06, - 0.272091977631616257711941025214e-04, - 0.670877521407181106194696282100e-03, - 0.798886677772299020922211491861e-02, - 0.508103869090520673569908110358e-01, - 0.183632701306997074156148485766e+00, - 0.391608988613030244504042313621e+00, - 0.502974888276186530840731361096e+00, - 0.391608988613030244504042313621e+00, - 0.183632701306997074156148485766e+00, - 0.508103869090520673569908110358e-01, - 0.798886677772299020922211491861e-02, - 0.670877521407181106194696282100e-03, - 0.272091977631616257711941025214e-04, - 0.448824314722312295179447915594e-06, - 0.216305100986355475019693077221e-08, - 0.132629709449851575185289154385e-11, - // weights 20 - 0.222939364553415129252250061603e-12, - 0.439934099227318055362885145547e-09, - 0.108606937076928169399952456345e-06, - 0.780255647853206369414599199965e-05, - 0.228338636016353967257145917963e-03, - 0.324377334223786183218324713235e-02, - 0.248105208874636108821649525589e-01, - 0.109017206020023320013755033535e+00, - 0.286675505362834129719659706228e+00, - 0.462243669600610089650328639861e+00, - 0.462243669600610089650328639861e+00, - 0.286675505362834129719659706228e+00, - 0.109017206020023320013755033535e+00, - 0.248105208874636108821649525589e-01, - 0.324377334223786183218324713235e-02, - 0.228338636016353967257145917963e-03, - 0.780255647853206369414599199965e-05, - 0.108606937076928169399952456345e-06, - 0.439934099227318055362885145547e-09, - 0.222939364553415129252250061603e-12, - // weights 30 - 0.290825470013122622941102747365e-20, - 0.281033360275090370876277491534e-16, - 0.287860708054870606219239791142e-13, - 0.810618629746304420399344796173e-11, - 0.917858042437852820850075742492e-09, - 0.510852245077594627738963204403e-07, - 0.157909488732471028834638794022e-05, - 0.293872522892298764150118423412e-04, - 0.348310124318685523420995323183e-03, - 0.273792247306765846298942568953e-02, - 0.147038297048266835152773557787e-01, - 0.551441768702342511680754948183e-01, - 0.146735847540890099751693643152e+00, - 0.280130930839212667413493211293e+00, - 0.386394889541813862555601849165e+00, - 0.386394889541813862555601849165e+00, - 0.280130930839212667413493211293e+00, - 0.146735847540890099751693643152e+00, - 0.551441768702342511680754948183e-01, - 0.147038297048266835152773557787e-01, - 0.273792247306765846298942568953e-02, - 0.348310124318685523420995323183e-03, - 0.293872522892298764150118423412e-04, - 0.157909488732471028834638794022e-05, - 0.510852245077594627738963204403e-07, - 0.917858042437852820850075742492e-09, - 0.810618629746304420399344796173e-11, - 0.287860708054870606219239791142e-13, - 0.281033360275090370876277491534e-16, - 0.290825470013122622941102747365e-20, - // weights 32 - 0.731067642736e-22, - 0.923173653649e-18, - 0.119734401709e-14, - 0.421501021125e-12, - 0.593329146300e-10, - 0.409883216476e-08, - 0.157416779254e-06, - 0.365058512955e-05, - 0.541658406172e-04, - 0.536268365526e-03, - 0.365489032664e-02, - 0.175534288315e-01, - 0.604581309557e-01, - 0.151269734076e+00, - 0.277458142302e+00, - 0.375238352592e+00, - 0.375238352592e+00, - 0.277458142302e+00, - 0.151269734076e+00, - 0.604581309557e-01, - 0.175534288315e-01, - 0.365489032664e-02, - 0.536268365526e-03, - 0.541658406172e-04, - 0.365058512955e-05, - 0.157416779254e-06, - 0.409883216476e-08, - 0.593329146300e-10, - 0.421501021125e-12, - 0.119734401709e-14, - 0.923173653649e-18, - 0.731067642736e-22, - // weights 40 - 0.259104371384e-28, - 0.854405696375e-24, - 0.256759336540e-20, - 0.198918101211e-17, - 0.600835878947e-15, - 0.880570764518e-13, - 0.715652805267e-11, - 0.352562079135e-09, - 0.112123608322e-07, - 0.241114416359e-06, - 0.363157615067e-05, - 0.393693398108e-04, - 0.313853594540e-03, - 0.187149682959e-02, - 0.846088800823e-02, - 0.293125655361e-01, - 0.784746058652e-01, - 0.163378732713e+00, - 0.265728251876e+00, - 0.338643277425e+00, - 0.338643277425e+00, - 0.265728251876e+00, - 0.163378732713e+00, - 0.784746058652e-01, - 0.293125655361e-01, - 0.846088800823e-02, - 0.187149682959e-02, - 0.313853594540e-03, - 0.393693398108e-04, - 0.363157615067e-05, - 0.241114416359e-06, - 0.112123608322e-07, - 0.352562079135e-09, - 0.715652805267e-11, - 0.880570764518e-13, - 0.600835878947e-15, - 0.198918101211e-17, - 0.256759336540e-20, - 0.854405696375e-24, - 0.259104371384e-28, - // weights 50 - 0.183379404857e-36, - 0.167380166790e-31, - 0.121524412340e-27, - 0.213765830835e-24, - 0.141709359957e-21, - 0.447098436530e-19, - 0.774238295702e-17, - 0.809426189344e-15, - 0.546594403180e-13, - 0.250665552389e-11, - 0.811187736448e-10, - 0.190904054379e-08, - 0.334679340401e-07, - 0.445702996680e-06, - 0.458168270794e-05, - 0.368401905377e-04, - 0.234269892109e-03, - 0.118901178175e-02, - 0.485326382616e-02, - 0.160319410684e-01, - 0.430791591566e-01, - 0.945489354768e-01, - 0.170032455676e+00, - 0.251130856331e+00, - 0.305085129203e+00, - 0.305085129203e+00, - 0.251130856331e+00, - 0.170032455676e+00, - 0.945489354768e-01, - 0.430791591566e-01, - 0.160319410684e-01, - 0.485326382616e-02, - 0.118901178175e-02, - 0.234269892109e-03, - 0.368401905377e-04, - 0.458168270794e-05, - 0.445702996680e-06, - 0.334679340401e-07, - 0.190904054379e-08, - 0.811187736448e-10, - 0.250665552389e-11, - 0.546594403180e-13, - 0.809426189344e-15, - 0.774238295702e-17, - 0.447098436530e-19, - 0.141709359957e-21, - 0.213765830835e-24, - 0.121524412340e-27, - 0.167380166790e-31, - 0.183379404857e-36, - // weights 60 - 0.110958724796e-44, - 0.243974758810e-39, - 0.377162672698e-35, - 0.133255961176e-31, - 0.171557314767e-28, - 0.102940599693e-25, - 0.334575695574e-23, - 0.651256725748e-21, - 0.815364047300e-19, - 0.692324790956e-17, - 0.415244410968e-15, - 0.181662457614e-13, - 0.594843051597e-12, - 0.148895734905e-10, - 0.289935901280e-09, - 0.445682277521e-08, - 0.547555461926e-07, - 0.543351613419e-06, - 0.439428693625e-05, - 0.291874190415e-04, - 0.160277334681e-03, - 0.731773556963e-03, - 0.279132482894e-02, - 0.893217836028e-02, - 0.240612727660e-01, - 0.547189709320e-01, - 0.105298763697e+00, - 0.171776156918e+00, - 0.237868904958e+00, - 0.279853117522e+00, - 0.279853117522e+00, - 0.237868904958e+00, - 0.171776156918e+00, - 0.105298763697e+00, - 0.547189709320e-01, - 0.240612727660e-01, - 0.893217836028e-02, - 0.279132482894e-02, - 0.731773556963e-03, - 0.160277334681e-03, - 0.291874190415e-04, - 0.439428693625e-05, - 0.543351613419e-06, - 0.547555461926e-07, - 0.445682277521e-08, - 0.289935901280e-09, - 0.148895734905e-10, - 0.594843051597e-12, - 0.181662457614e-13, - 0.415244410968e-15, - 0.692324790956e-17, - 0.815364047300e-19, - 0.651256725748e-21, - 0.334575695574e-23, - 0.102940599693e-25, - 0.171557314767e-28, - 0.133255961176e-31, - 0.377162672698e-35, - 0.243974758810e-39, - 0.110958724796e-44, - // weights 64 - 0.553570653584e-48, - 0.167974799010e-42, - 0.342113801099e-38, - 0.155739062462e-34, - 0.254966089910e-31, - 0.192910359546e-28, - 0.786179778889e-26, - 0.191170688329e-23, - 0.298286278427e-21, - 0.315225456649e-19, - 0.235188471067e-17, - 0.128009339117e-15, - 0.521862372645e-14, - 0.162834073070e-12, - 0.395917776693e-11, - 0.761521725012e-10, - 0.117361674232e-08, - 0.146512531647e-07, - 0.149553293672e-06, - 0.125834025103e-05, - 0.878849923082e-05, - 0.512592913577e-04, - 0.250983698512e-03, - 0.103632909950e-02, - 0.362258697852e-02, - 0.107560405098e-01, - 0.272031289536e-01, - 0.587399819634e-01, - 0.108498349306e+00, - 0.171685842349e+00, - 0.232994786062e+00, - 0.271377424940e+00, - 0.271377424940e+00, - 0.232994786062e+00, - 0.171685842349e+00, - 0.108498349306e+00, - 0.587399819634e-01, - 0.272031289536e-01, - 0.107560405098e-01, - 0.362258697852e-02, - 0.103632909950e-02, - 0.250983698512e-03, - 0.512592913577e-04, - 0.878849923082e-05, - 0.125834025103e-05, - 0.149553293672e-06, - 0.146512531647e-07, - 0.117361674232e-08, - 0.761521725012e-10, - 0.395917776693e-11, - 0.162834073070e-12, - 0.521862372645e-14, - 0.128009339117e-15, - 0.235188471067e-17, - 0.315225456649e-19, - 0.298286278427e-21, - 0.191170688329e-23, - 0.786179778889e-26, - 0.192910359546e-28, - 0.254966089910e-31, - 0.155739062462e-34, - 0.342113801099e-38, - 0.167974799010e-42, - 0.553570653584e-48 -}; +static const double gh_weights[] = + { + // weights 1 = √π + 1.77245385090551588191942755656782537698745727539062, + // weights 2 + 0.886226925452758013649083741671e+00, + 0.886226925452758013649083741671e+00, + // weights 3 + 0.295408975150919337883027913890e+00, + 0.118163590060367735153211165556e+01, + 0.295408975150919337883027913890e+00, + // weights 4 + 0.813128354472451771430345571899e-01, + 0.804914090005512836506049184481e+00, + 0.804914090005512836506049184481e+00, + 0.813128354472451771430345571899e-01, + // weights 5 + 0.199532420590459132077434585942e-01, + 0.393619323152241159828495620852e+00, + 0.945308720482941881225689324449e+00, + 0.393619323152241159828495620852e+00, + 0.199532420590459132077434585942e-01, + // weights 6 + 0.453000990550884564085747256463e-02, + 0.157067320322856643916311563508e+00, + 0.724629595224392524091914705598e+00, + 0.724629595224392524091914705598e+00, + 0.157067320322856643916311563508e+00, + 0.453000990550884564085747256463e-02, + // weights 7 + 0.971781245099519154149424255939e-03, + 0.545155828191270305921785688417e-01, + 0.425607252610127800520317466666e+00, + 0.810264617556807326764876563813e+00, + 0.425607252610127800520317466666e+00, + 0.545155828191270305921785688417e-01, + 0.971781245099519154149424255939e-03, + // weights 8 + 0.199604072211367619206090452544e-03, + 0.170779830074134754562030564364e-01, + 0.207802325814891879543258620286e+00, + 0.661147012558241291030415974496e+00, + 0.661147012558241291030415974496e+00, + 0.207802325814891879543258620286e+00, + 0.170779830074134754562030564364e-01, + 0.199604072211367619206090452544e-03, + // weights 9 + 0.396069772632643819045862946425e-04, + 0.494362427553694721722456597763e-02, + 0.884745273943765732879751147476e-01, + 0.432651559002555750199812112956e+00, + 0.720235215606050957124334723389e+00, + 0.432651559002555750199812112956e+00, + 0.884745273943765732879751147476e-01, + 0.494362427553694721722456597763e-02, + 0.396069772632643819045862946425e-04, + // weights 10 + 0.764043285523262062915936785960e-05, + 0.134364574678123269220156558585e-02, + 0.338743944554810631361647312776e-01, + 0.240138611082314686416523295006e+00, + 0.610862633735325798783564990433e+00, + 0.610862633735325798783564990433e+00, + 0.240138611082314686416523295006e+00, + 0.338743944554810631361647312776e-01, + 0.134364574678123269220156558585e-02, + 0.764043285523262062915936785960e-05, + // weights 11 + 0.143956039371425822033088366032e-05, + 0.346819466323345510643413772940e-03, + 0.119113954449115324503874202916e-01, + 0.117227875167708503381788649308e+00, + 0.429359752356125028446073598601e+00, + 0.654759286914591779203940657627e+00, + 0.429359752356125028446073598601e+00, + 0.117227875167708503381788649308e+00, + 0.119113954449115324503874202916e-01, + 0.346819466323345510643413772940e-03, + 0.143956039371425822033088366032e-05, + // weights 12 + 0.265855168435630160602311400877e-06, + 0.857368704358785865456906323153e-04, + 0.390539058462906185999438432620e-02, + 0.516079856158839299918734423606e-01, + 0.260492310264161129233396139765e+00, + 0.570135236262479578347113482275e+00, + 0.570135236262479578347113482275e+00, + 0.260492310264161129233396139765e+00, + 0.516079856158839299918734423606e-01, + 0.390539058462906185999438432620e-02, + 0.857368704358785865456906323153e-04, + 0.265855168435630160602311400877e-06, + // weights 13 + 0.482573185007313108834997332342e-07, + 0.204303604027070731248669432937e-04, + 0.120745999271938594730924899224e-02, + 0.208627752961699392166033805050e-01, + 0.140323320687023437762792268873e+00, + 0.421616296898543221746893558568e+00, + 0.604393187921161642342099068579e+00, + 0.421616296898543221746893558568e+00, + 0.140323320687023437762792268873e+00, + 0.208627752961699392166033805050e-01, + 0.120745999271938594730924899224e-02, + 0.204303604027070731248669432937e-04, + 0.482573185007313108834997332342e-07, + // weights 14 + 0.862859116812515794532041783429e-08, + 0.471648435501891674887688950105e-05, + 0.355092613551923610483661076691e-03, + 0.785005472645794431048644334608e-02, + 0.685055342234652055387163312367e-01, + 0.273105609064246603352569187026e+00, + 0.536405909712090149794921296776e+00, + 0.536405909712090149794921296776e+00, + 0.273105609064246603352569187026e+00, + 0.685055342234652055387163312367e-01, + 0.785005472645794431048644334608e-02, + 0.355092613551923610483661076691e-03, + 0.471648435501891674887688950105e-05, + 0.862859116812515794532041783429e-08, + // weights 15 + 0.152247580425351702016062666965e-08, + 0.105911554771106663577520791055e-05, + 0.100004441232499868127296736177e-03, + 0.277806884291277589607887049229e-02, + 0.307800338725460822286814158758e-01, + 0.158488915795935746883839384960e+00, + 0.412028687498898627025891079568e+00, + 0.564100308726417532852625797340e+00, + 0.412028687498898627025891079568e+00, + 0.158488915795935746883839384960e+00, + 0.307800338725460822286814158758e-01, + 0.277806884291277589607887049229e-02, + 0.100004441232499868127296736177e-03, + 0.105911554771106663577520791055e-05, + 0.152247580425351702016062666965e-08, + // weights 16 + 0.265480747401118224470926366050e-09, + 0.232098084486521065338749423185e-06, + 0.271186009253788151201891432244e-04, + 0.932284008624180529914277305537e-03, + 0.128803115355099736834642999312e-01, + 0.838100413989858294154207349001e-01, + 0.280647458528533675369463335380e+00, + 0.507929479016613741913517341791e+00, + 0.507929479016613741913517341791e+00, + 0.280647458528533675369463335380e+00, + 0.838100413989858294154207349001e-01, + 0.128803115355099736834642999312e-01, + 0.932284008624180529914277305537e-03, + 0.271186009253788151201891432244e-04, + 0.232098084486521065338749423185e-06, + 0.265480747401118224470926366050e-09, + // weights 17 + 0.458057893079863330580889281222e-10, + 0.497707898163079405227863353715e-07, + 0.711228914002130958353327376218e-05, + 0.298643286697753041151336643059e-03, + 0.506734995762753791170069495879e-02, + 0.409200341495762798094994877854e-01, + 0.172648297670097079217645196219e+00, + 0.401826469470411956577635085257e+00, + 0.530917937624863560331883103379e+00, + 0.401826469470411956577635085257e+00, + 0.172648297670097079217645196219e+00, + 0.409200341495762798094994877854e-01, + 0.506734995762753791170069495879e-02, + 0.298643286697753041151336643059e-03, + 0.711228914002130958353327376218e-05, + 0.497707898163079405227863353715e-07, + 0.458057893079863330580889281222e-10, + // weights 18 + 0.782819977211589102925147471012e-11, + 0.104672057957920824443559608435e-07, + 0.181065448109343040959702385911e-05, + 0.918112686792940352914675407371e-04, + 0.188852263026841789438175325426e-02, + 0.186400423875446519219315221973e-01, + 0.973017476413154293308537234155e-01, + 0.284807285669979578595606820713e+00, + 0.483495694725455552876410522141e+00, + 0.483495694725455552876410522141e+00, + 0.284807285669979578595606820713e+00, + 0.973017476413154293308537234155e-01, + 0.186400423875446519219315221973e-01, + 0.188852263026841789438175325426e-02, + 0.918112686792940352914675407371e-04, + 0.181065448109343040959702385911e-05, + 0.104672057957920824443559608435e-07, + 0.782819977211589102925147471012e-11, + // weights 19 + 0.132629709449851575185289154385e-11, + 0.216305100986355475019693077221e-08, + 0.448824314722312295179447915594e-06, + 0.272091977631616257711941025214e-04, + 0.670877521407181106194696282100e-03, + 0.798886677772299020922211491861e-02, + 0.508103869090520673569908110358e-01, + 0.183632701306997074156148485766e+00, + 0.391608988613030244504042313621e+00, + 0.502974888276186530840731361096e+00, + 0.391608988613030244504042313621e+00, + 0.183632701306997074156148485766e+00, + 0.508103869090520673569908110358e-01, + 0.798886677772299020922211491861e-02, + 0.670877521407181106194696282100e-03, + 0.272091977631616257711941025214e-04, + 0.448824314722312295179447915594e-06, + 0.216305100986355475019693077221e-08, + 0.132629709449851575185289154385e-11, + // weights 20 + 0.222939364553415129252250061603e-12, + 0.439934099227318055362885145547e-09, + 0.108606937076928169399952456345e-06, + 0.780255647853206369414599199965e-05, + 0.228338636016353967257145917963e-03, + 0.324377334223786183218324713235e-02, + 0.248105208874636108821649525589e-01, + 0.109017206020023320013755033535e+00, + 0.286675505362834129719659706228e+00, + 0.462243669600610089650328639861e+00, + 0.462243669600610089650328639861e+00, + 0.286675505362834129719659706228e+00, + 0.109017206020023320013755033535e+00, + 0.248105208874636108821649525589e-01, + 0.324377334223786183218324713235e-02, + 0.228338636016353967257145917963e-03, + 0.780255647853206369414599199965e-05, + 0.108606937076928169399952456345e-06, + 0.439934099227318055362885145547e-09, + 0.222939364553415129252250061603e-12, + // weights 30 + 0.290825470013122622941102747365e-20, + 0.281033360275090370876277491534e-16, + 0.287860708054870606219239791142e-13, + 0.810618629746304420399344796173e-11, + 0.917858042437852820850075742492e-09, + 0.510852245077594627738963204403e-07, + 0.157909488732471028834638794022e-05, + 0.293872522892298764150118423412e-04, + 0.348310124318685523420995323183e-03, + 0.273792247306765846298942568953e-02, + 0.147038297048266835152773557787e-01, + 0.551441768702342511680754948183e-01, + 0.146735847540890099751693643152e+00, + 0.280130930839212667413493211293e+00, + 0.386394889541813862555601849165e+00, + 0.386394889541813862555601849165e+00, + 0.280130930839212667413493211293e+00, + 0.146735847540890099751693643152e+00, + 0.551441768702342511680754948183e-01, + 0.147038297048266835152773557787e-01, + 0.273792247306765846298942568953e-02, + 0.348310124318685523420995323183e-03, + 0.293872522892298764150118423412e-04, + 0.157909488732471028834638794022e-05, + 0.510852245077594627738963204403e-07, + 0.917858042437852820850075742492e-09, + 0.810618629746304420399344796173e-11, + 0.287860708054870606219239791142e-13, + 0.281033360275090370876277491534e-16, + 0.290825470013122622941102747365e-20, + // weights 32 + 0.731067642736e-22, + 0.923173653649e-18, + 0.119734401709e-14, + 0.421501021125e-12, + 0.593329146300e-10, + 0.409883216476e-08, + 0.157416779254e-06, + 0.365058512955e-05, + 0.541658406172e-04, + 0.536268365526e-03, + 0.365489032664e-02, + 0.175534288315e-01, + 0.604581309557e-01, + 0.151269734076e+00, + 0.277458142302e+00, + 0.375238352592e+00, + 0.375238352592e+00, + 0.277458142302e+00, + 0.151269734076e+00, + 0.604581309557e-01, + 0.175534288315e-01, + 0.365489032664e-02, + 0.536268365526e-03, + 0.541658406172e-04, + 0.365058512955e-05, + 0.157416779254e-06, + 0.409883216476e-08, + 0.593329146300e-10, + 0.421501021125e-12, + 0.119734401709e-14, + 0.923173653649e-18, + 0.731067642736e-22, + // weights 40 + 0.259104371384e-28, + 0.854405696375e-24, + 0.256759336540e-20, + 0.198918101211e-17, + 0.600835878947e-15, + 0.880570764518e-13, + 0.715652805267e-11, + 0.352562079135e-09, + 0.112123608322e-07, + 0.241114416359e-06, + 0.363157615067e-05, + 0.393693398108e-04, + 0.313853594540e-03, + 0.187149682959e-02, + 0.846088800823e-02, + 0.293125655361e-01, + 0.784746058652e-01, + 0.163378732713e+00, + 0.265728251876e+00, + 0.338643277425e+00, + 0.338643277425e+00, + 0.265728251876e+00, + 0.163378732713e+00, + 0.784746058652e-01, + 0.293125655361e-01, + 0.846088800823e-02, + 0.187149682959e-02, + 0.313853594540e-03, + 0.393693398108e-04, + 0.363157615067e-05, + 0.241114416359e-06, + 0.112123608322e-07, + 0.352562079135e-09, + 0.715652805267e-11, + 0.880570764518e-13, + 0.600835878947e-15, + 0.198918101211e-17, + 0.256759336540e-20, + 0.854405696375e-24, + 0.259104371384e-28, + // weights 50 + 0.183379404857e-36, + 0.167380166790e-31, + 0.121524412340e-27, + 0.213765830835e-24, + 0.141709359957e-21, + 0.447098436530e-19, + 0.774238295702e-17, + 0.809426189344e-15, + 0.546594403180e-13, + 0.250665552389e-11, + 0.811187736448e-10, + 0.190904054379e-08, + 0.334679340401e-07, + 0.445702996680e-06, + 0.458168270794e-05, + 0.368401905377e-04, + 0.234269892109e-03, + 0.118901178175e-02, + 0.485326382616e-02, + 0.160319410684e-01, + 0.430791591566e-01, + 0.945489354768e-01, + 0.170032455676e+00, + 0.251130856331e+00, + 0.305085129203e+00, + 0.305085129203e+00, + 0.251130856331e+00, + 0.170032455676e+00, + 0.945489354768e-01, + 0.430791591566e-01, + 0.160319410684e-01, + 0.485326382616e-02, + 0.118901178175e-02, + 0.234269892109e-03, + 0.368401905377e-04, + 0.458168270794e-05, + 0.445702996680e-06, + 0.334679340401e-07, + 0.190904054379e-08, + 0.811187736448e-10, + 0.250665552389e-11, + 0.546594403180e-13, + 0.809426189344e-15, + 0.774238295702e-17, + 0.447098436530e-19, + 0.141709359957e-21, + 0.213765830835e-24, + 0.121524412340e-27, + 0.167380166790e-31, + 0.183379404857e-36, + // weights 60 + 0.110958724796e-44, + 0.243974758810e-39, + 0.377162672698e-35, + 0.133255961176e-31, + 0.171557314767e-28, + 0.102940599693e-25, + 0.334575695574e-23, + 0.651256725748e-21, + 0.815364047300e-19, + 0.692324790956e-17, + 0.415244410968e-15, + 0.181662457614e-13, + 0.594843051597e-12, + 0.148895734905e-10, + 0.289935901280e-09, + 0.445682277521e-08, + 0.547555461926e-07, + 0.543351613419e-06, + 0.439428693625e-05, + 0.291874190415e-04, + 0.160277334681e-03, + 0.731773556963e-03, + 0.279132482894e-02, + 0.893217836028e-02, + 0.240612727660e-01, + 0.547189709320e-01, + 0.105298763697e+00, + 0.171776156918e+00, + 0.237868904958e+00, + 0.279853117522e+00, + 0.279853117522e+00, + 0.237868904958e+00, + 0.171776156918e+00, + 0.105298763697e+00, + 0.547189709320e-01, + 0.240612727660e-01, + 0.893217836028e-02, + 0.279132482894e-02, + 0.731773556963e-03, + 0.160277334681e-03, + 0.291874190415e-04, + 0.439428693625e-05, + 0.543351613419e-06, + 0.547555461926e-07, + 0.445682277521e-08, + 0.289935901280e-09, + 0.148895734905e-10, + 0.594843051597e-12, + 0.181662457614e-13, + 0.415244410968e-15, + 0.692324790956e-17, + 0.815364047300e-19, + 0.651256725748e-21, + 0.334575695574e-23, + 0.102940599693e-25, + 0.171557314767e-28, + 0.133255961176e-31, + 0.377162672698e-35, + 0.243974758810e-39, + 0.110958724796e-44, + // weights 64 + 0.553570653584e-48, + 0.167974799010e-42, + 0.342113801099e-38, + 0.155739062462e-34, + 0.254966089910e-31, + 0.192910359546e-28, + 0.786179778889e-26, + 0.191170688329e-23, + 0.298286278427e-21, + 0.315225456649e-19, + 0.235188471067e-17, + 0.128009339117e-15, + 0.521862372645e-14, + 0.162834073070e-12, + 0.395917776693e-11, + 0.761521725012e-10, + 0.117361674232e-08, + 0.146512531647e-07, + 0.149553293672e-06, + 0.125834025103e-05, + 0.878849923082e-05, + 0.512592913577e-04, + 0.250983698512e-03, + 0.103632909950e-02, + 0.362258697852e-02, + 0.107560405098e-01, + 0.272031289536e-01, + 0.587399819634e-01, + 0.108498349306e+00, + 0.171685842349e+00, + 0.232994786062e+00, + 0.271377424940e+00, + 0.271377424940e+00, + 0.232994786062e+00, + 0.171685842349e+00, + 0.108498349306e+00, + 0.587399819634e-01, + 0.272031289536e-01, + 0.107560405098e-01, + 0.362258697852e-02, + 0.103632909950e-02, + 0.250983698512e-03, + 0.512592913577e-04, + 0.878849923082e-05, + 0.125834025103e-05, + 0.149553293672e-06, + 0.146512531647e-07, + 0.117361674232e-08, + 0.761521725012e-10, + 0.395917776693e-11, + 0.162834073070e-12, + 0.521862372645e-14, + 0.128009339117e-15, + 0.235188471067e-17, + 0.315225456649e-19, + 0.298286278427e-21, + 0.191170688329e-23, + 0.786179778889e-26, + 0.192910359546e-28, + 0.254966089910e-31, + 0.155739062462e-34, + 0.342113801099e-38, + 0.167974799010e-42, + 0.553570653584e-48 + }; // Points, starting with the first level -static const double gh_points[] = { - // points 1 - 0.0, - // points 2 - -0.707106781186547524400844362105e+00, - 0.707106781186547524400844362105e+00, - // points 3 - -0.122474487139158904909864203735e+01, - 0.0e+00, - 0.122474487139158904909864203735e+01, - // points 4 - -0.165068012388578455588334111112e+01, - -0.524647623275290317884060253835e+00, - 0.524647623275290317884060253835e+00, - 0.165068012388578455588334111112e+01, - // points 5 - -0.202018287045608563292872408814e+01, - -0.958572464613818507112770593893e+00, - 0.0e+00, - 0.958572464613818507112770593893e+00, - 0.202018287045608563292872408814e+01, - // points 6 - -0.235060497367449222283392198706e+01, - -0.133584907401369694971489528297e+01, - -0.436077411927616508679215948251e+00, - 0.436077411927616508679215948251e+00, - 0.133584907401369694971489528297e+01, - 0.235060497367449222283392198706e+01, - // points 7 - -0.265196135683523349244708200652e+01, - -0.167355162876747144503180139830e+01, - -0.816287882858964663038710959027e+00, - 0.0e+00, - 0.816287882858964663038710959027e+00, - 0.167355162876747144503180139830e+01, - 0.265196135683523349244708200652e+01, - // points 8 - -0.293063742025724401922350270524e+01, - -0.198165675669584292585463063977e+01, - -0.115719371244678019472076577906e+01, - -0.381186990207322116854718885584e+00, - 0.381186990207322116854718885584e+00, - 0.115719371244678019472076577906e+01, - 0.198165675669584292585463063977e+01, - 0.293063742025724401922350270524e+01, - // points 9 - -0.319099320178152760723004779538e+01, - -0.226658058453184311180209693284e+01, - -0.146855328921666793166701573925e+01, - -0.723551018752837573322639864579e+00, - 0.0e+00, - 0.723551018752837573322639864579e+00, - 0.146855328921666793166701573925e+01, - 0.226658058453184311180209693284e+01, - 0.319099320178152760723004779538e+01, - // points 10 - -0.343615911883773760332672549432e+01, - -0.253273167423278979640896079775e+01, - -0.175668364929988177345140122011e+01, - -0.103661082978951365417749191676e+01, - -0.342901327223704608789165025557e+00, - 0.342901327223704608789165025557e+00, - 0.103661082978951365417749191676e+01, - 0.175668364929988177345140122011e+01, - 0.253273167423278979640896079775e+01, - 0.343615911883773760332672549432e+01, - // points 11 - -0.366847084655958251845837146485e+01, - -0.278329009978165177083671870152e+01, - -0.202594801582575533516591283121e+01, - -0.132655708449493285594973473558e+01, - -0.656809566882099765024611575383e+00, - 0.0e+00, - 0.656809566882099765024611575383e+00, - 0.132655708449493285594973473558e+01, - 0.202594801582575533516591283121e+01, - 0.278329009978165177083671870152e+01, - 0.366847084655958251845837146485e+01, - // points 12 - -0.388972489786978191927164274724e+01, - -0.302063702512088977171067937518e+01, - -0.227950708050105990018772856942e+01, - -0.159768263515260479670966277090e+01, - -0.947788391240163743704578131060e+00, - -0.314240376254359111276611634095e+00, - 0.314240376254359111276611634095e+00, - 0.947788391240163743704578131060e+00, - 0.159768263515260479670966277090e+01, - 0.227950708050105990018772856942e+01, - 0.302063702512088977171067937518e+01, - 0.388972489786978191927164274724e+01, - // points 13 - -0.410133759617863964117891508007e+01, - -0.324660897837240998812205115236e+01, - -0.251973568567823788343040913628e+01, - -0.185310765160151214200350644316e+01, - -0.122005503659074842622205526637e+01, - -0.605763879171060113080537108602e+00, - 0.0e+00, - 0.605763879171060113080537108602e+00, - 0.122005503659074842622205526637e+01, - 0.185310765160151214200350644316e+01, - 0.251973568567823788343040913628e+01, - 0.324660897837240998812205115236e+01, - 0.410133759617863964117891508007e+01, - // points 14 - -0.430444857047363181262129810037e+01, - -0.346265693360227055020891736115e+01, - -0.274847072498540256862499852415e+01, - -0.209518325850771681573497272630e+01, - -0.147668273114114087058350654421e+01, - -0.878713787329399416114679311861e+00, - -0.291745510672562078446113075799e+00, - 0.291745510672562078446113075799e+00, - 0.878713787329399416114679311861e+00, - 0.147668273114114087058350654421e+01, - 0.209518325850771681573497272630e+01, - 0.274847072498540256862499852415e+01, - 0.346265693360227055020891736115e+01, - 0.430444857047363181262129810037e+01, - // points 15 - -0.449999070730939155366438053053e+01, - -0.366995037340445253472922383312e+01, - -0.296716692790560324848896036355e+01, - -0.232573248617385774545404479449e+01, - -0.171999257518648893241583152515e+01, - -0.113611558521092066631913490556e+01, - -0.565069583255575748526020337198e+00, - 0.0e+00, - 0.565069583255575748526020337198e+00, - 0.113611558521092066631913490556e+01, - 0.171999257518648893241583152515e+01, - 0.232573248617385774545404479449e+01, - 0.296716692790560324848896036355e+01, - 0.366995037340445253472922383312e+01, - 0.449999070730939155366438053053e+01, - // points 16 - -0.468873893930581836468849864875e+01, - -0.386944790486012269871942409801e+01, - -0.317699916197995602681399455926e+01, - -0.254620215784748136215932870545e+01, - -0.195178799091625397743465541496e+01, - -0.138025853919888079637208966969e+01, - -0.822951449144655892582454496734e+00, - -0.273481046138152452158280401965e+00, - 0.273481046138152452158280401965e+00, - 0.822951449144655892582454496734e+00, - 0.138025853919888079637208966969e+01, - 0.195178799091625397743465541496e+01, - 0.254620215784748136215932870545e+01, - 0.317699916197995602681399455926e+01, - 0.386944790486012269871942409801e+01, - 0.468873893930581836468849864875e+01, - // points 17 - -0.487134519367440308834927655662e+01, - -0.406194667587547430689245559698e+01, - -0.337893209114149408338327069289e+01, - -0.275776291570388873092640349574e+01, - -0.217350282666662081927537907149e+01, - -0.161292431422123133311288254454e+01, - -0.106764872574345055363045773799e+01, - -0.531633001342654731349086553718e+00, - 0.0e+00, - 0.531633001342654731349086553718e+00, - 0.106764872574345055363045773799e+01, - 0.161292431422123133311288254454e+01, - 0.217350282666662081927537907149e+01, - 0.275776291570388873092640349574e+01, - 0.337893209114149408338327069289e+01, - 0.406194667587547430689245559698e+01, - 0.487134519367440308834927655662e+01, - // points 18 - -0.504836400887446676837203757885e+01, - -0.424811787356812646302342016090e+01, - -0.357376906848626607950067599377e+01, - -0.296137750553160684477863254906e+01, - -0.238629908916668600026459301424e+01, - -0.183553160426162889225383944409e+01, - -0.130092085838961736566626555439e+01, - -0.776682919267411661316659462284e+00, - -0.258267750519096759258116098711e+00, - 0.258267750519096759258116098711e+00, - 0.776682919267411661316659462284e+00, - 0.130092085838961736566626555439e+01, - 0.183553160426162889225383944409e+01, - 0.238629908916668600026459301424e+01, - 0.296137750553160684477863254906e+01, - 0.357376906848626607950067599377e+01, - 0.424811787356812646302342016090e+01, - 0.504836400887446676837203757885e+01, - // points 19 - -0.522027169053748216460967142500e+01, - -0.442853280660377943723498532226e+01, - -0.376218735196402009751489394104e+01, - -0.315784881834760228184318034120e+01, - -0.259113378979454256492128084112e+01, - -0.204923170985061937575050838669e+01, - -0.152417061939353303183354859367e+01, - -0.101036838713431135136859873726e+01, - -0.503520163423888209373811765050e+00, - 0.0e+00, - 0.503520163423888209373811765050e+00, - 0.101036838713431135136859873726e+01, - 0.152417061939353303183354859367e+01, - 0.204923170985061937575050838669e+01, - 0.259113378979454256492128084112e+01, - 0.315784881834760228184318034120e+01, - 0.376218735196402009751489394104e+01, - 0.442853280660377943723498532226e+01, - 0.522027169053748216460967142500e+01, - // points 20 - -0.538748089001123286201690041068e+01, - -0.460368244955074427307767524898e+01, - -0.394476404011562521037562880052e+01, - -0.334785456738321632691492452300e+01, - -0.278880605842813048052503375640e+01, - -0.225497400208927552308233334473e+01, - -0.173853771211658620678086566214e+01, - -0.123407621539532300788581834696e+01, - -0.737473728545394358705605144252e+00, - -0.245340708300901249903836530634e+00, - 0.245340708300901249903836530634e+00, - 0.737473728545394358705605144252e+00, - 0.123407621539532300788581834696e+01, - 0.173853771211658620678086566214e+01, - 0.225497400208927552308233334473e+01, - 0.278880605842813048052503375640e+01, - 0.334785456738321632691492452300e+01, - 0.394476404011562521037562880052e+01, - 0.460368244955074427307767524898e+01, - 0.538748089001123286201690041068e+01, - // points 30 - -6.86334529352989158106110835756e+00, - -6.13827922012393462039499237854e+00, - -5.53314715156749572511833355558e+00, - -4.98891896858994394448649710633e+00, - -4.48305535709251834188703761971e+00, - -4.00390860386122881522787601332e+00, - -3.54444387315534988692540090217e+00, - -3.09997052958644174868873332237e+00, - -2.66713212453561720057110646422e+00, - -2.24339146776150407247297999483e+00, - -1.82674114360368803883588048351e+00, - -1.41552780019818851194072510555e+00, - -1.00833827104672346180498960870e+00, - -0.603921058625552307778155678757e+00, - -0.201128576548871485545763013244e+00, - 0.201128576548871485545763013244e+00, - 0.603921058625552307778155678757e+00, - 1.00833827104672346180498960870e+00, - 1.41552780019818851194072510555e+00, - 1.82674114360368803883588048351e+00, - 2.24339146776150407247297999483e+00, - 2.66713212453561720057110646422e+00, - 3.09997052958644174868873332237e+00, - 3.54444387315534988692540090217e+00, - 4.00390860386122881522787601332e+00, - 4.48305535709251834188703761971e+00, - 4.98891896858994394448649710633e+00, - 5.53314715156749572511833355558e+00, - 6.13827922012393462039499237854e+00, - 6.86334529352989158106110835756e+00, - // points 32 - -7.12581390983e+00, - -6.40949814927e+00, - -5.81222594952e+00, - -5.27555098652e+00, - -4.77716450350e+00, - -4.30554795335e+00, - -3.85375548547e+00, - -3.41716749282e+00, - -2.99249082500e+00, - -2.57724953773e+00, - -2.16949918361e+00, - -1.76765410946e+00, - -1.37037641095e+00, - -0.976500463590e+00, - -0.584978765436e+00, - -0.194840741569e+00, - 0.194840741569e+00, - 0.584978765436e+00, - 0.976500463590e+00, - 1.37037641095e+00, - 1.76765410946e+00, - 2.16949918361e+00, - 2.57724953773e+00, - 2.99249082500e+00, - 3.41716749282e+00, - 3.85375548547e+00, - 4.30554795335e+00, - 4.77716450350e+00, - 5.27555098652e+00, - 5.81222594952e+00, - 6.40949814927e+00, - 7.12581390983e+00, - // points 40 - -8.09876113925e+00, - -7.41158253149e+00, - -6.84023730525e+00, - -6.32825535122e+00, - -5.85409505603e+00, - -5.40665424797e+00, - -4.97926097855e+00, - -4.56750207284e+00, - -4.16825706683e+00, - -3.77920675344e+00, - -3.39855826586e+00, - -3.02487988390e+00, - -2.65699599844e+00, - -2.29391714188e+00, - -1.93479147228e+00, - -1.57886989493e+00, - -1.22548010905e+00, - -0.874006612357e+00, - -0.523874713832e+00, - -0.174537214598e+00, - 0.174537214598e+00, - 0.523874713832e+00, - 0.874006612357e+00, - 1.22548010905e+00, - 1.57886989493e+00, - 1.93479147228e+00, - 2.29391714188e+00, - 2.65699599844e+00, - 3.02487988390e+00, - 3.39855826586e+00, - 3.77920675344e+00, - 4.16825706683e+00, - 4.56750207284e+00, - 4.97926097855e+00, - 5.40665424797e+00, - 5.85409505603e+00, - 6.32825535122e+00, - 6.84023730525e+00, - 7.41158253149e+00, - 8.09876113925e+00, - // points 50 - -9.18240695813e+00, - -8.52277103092e+00, - -7.97562236821e+00, - -7.48640942986e+00, - -7.03432350977e+00, - -6.60864797386e+00, - -6.20295251927e+00, - -5.81299467542e+00, - -5.43578608722e+00, - -5.06911758492e+00, - -4.71129366617e+00, - -4.36097316045e+00, - -4.01706817286e+00, - -3.67867706252e+00, - -3.34503831394e+00, - -3.01549776957e+00, - -2.68948470227e+00, - -2.36649390430e+00, - -2.04607196869e+00, - -1.72780654752e+00, - -1.41131775490e+00, - -1.09625112896e+00, - -0.782271729555e+00, - -0.469059056678e+00, - -0.156302546889e+00, - 0.156302546889e+00, - 0.469059056678e+00, - 0.782271729555e+00, - 1.09625112896e+00, - 1.41131775490e+00, - 1.72780654752e+00, - 2.04607196869e+00, - 2.36649390430e+00, - 2.68948470227e+00, - 3.01549776957e+00, - 3.34503831394e+00, - 3.67867706252e+00, - 4.01706817286e+00, - 4.36097316045e+00, - 4.71129366617e+00, - 5.06911758492e+00, - 5.43578608722e+00, - 5.81299467542e+00, - 6.20295251927e+00, - 6.60864797386e+00, - 7.03432350977e+00, - 7.48640942986e+00, - 7.97562236821e+00, - 8.52277103092e+00, - 9.18240695813e+00, - // points 60 - -10.1591092462e+00, - -9.52090367701e+00, - -8.99239800140e+00, - -8.52056928412e+00, - -8.08518865425e+00, - -7.67583993750e+00, - -7.28627659440e+00, - -6.91238153219e+00, - -6.55125916706e+00, - -6.20077355799e+00, - -5.85929019639e+00, - -5.52552108614e+00, - -5.19842653458e+00, - -4.87715007747e+00, - -4.56097375794e+00, - -4.24928643596e+00, - -3.94156073393e+00, - -3.63733587617e+00, - -3.33620465355e+00, - -3.03780333823e+00, - -2.74180374807e+00, - -2.44790690231e+00, - -2.15583787123e+00, - -1.86534153123e+00, - -1.57617901198e+00, - -1.28812467487e+00, - -1.00096349956e+00, - -0.714488781673e+00, - -0.428500064221e+00, - -0.142801238703e+00, - 0.142801238703e+00, - 0.428500064221e+00, - 0.714488781673e+00, - 1.00096349956e+00, - 1.28812467487e+00, - 1.57617901198e+00, - 1.86534153123e+00, - 2.15583787123e+00, - 2.44790690231e+00, - 2.74180374807e+00, - 3.03780333823e+00, - 3.33620465355e+00, - 3.63733587617e+00, - 3.94156073393e+00, - 4.24928643596e+00, - 4.56097375794e+00, - 4.87715007747e+00, - 5.19842653458e+00, - 5.52552108614e+00, - 5.85929019639e+00, - 6.20077355799e+00, - 6.55125916706e+00, - 6.91238153219e+00, - 7.28627659440e+00, - 7.67583993750e+00, - 8.08518865425e+00, - 8.52056928412e+00, - 8.99239800140e+00, - 9.52090367701e+00, - 10.1591092462e+00, - // points 64 - -10.5261231680e+00, - -9.89528758683e+00, - -9.37315954965e+00, - -8.90724909996e+00, - -8.47752908338e+00, - -8.07368728501e+00, - -7.68954016404e+00, - -7.32101303278e+00, - -6.96524112055e+00, - -6.62011226264e+00, - -6.28401122877e+00, - -5.95566632680e+00, - -5.63405216435e+00, - -5.31832522463e+00, - -5.00777960220e+00, - -4.70181564741e+00, - -4.39991716823e+00, - -4.10163447457e+00, - -3.80657151395e+00, - -3.51437593574e+00, - -3.22473129199e+00, - -2.93735082300e+00, - -2.65197243543e+00, - -2.36835458863e+00, - -2.08627287988e+00, - -1.80551717147e+00, - -1.52588914021e+00, - -1.24720015694e+00, - -0.969269423071e+00, - -0.691922305810e+00, - -0.414988824121e+00, - -0.138302244987e+00, - 0.138302244987e+00, - 0.414988824121e+00, - 0.691922305810e+00, - 0.969269423071e+00, - 1.24720015694e+00, - 1.52588914021e+00, - 1.80551717147e+00, - 2.08627287988e+00, - 2.36835458863e+00, - 2.65197243543e+00, - 2.93735082300e+00, - 3.22473129199e+00, - 3.51437593574e+00, - 3.80657151395e+00, - 4.10163447457e+00, - 4.39991716823e+00, - 4.70181564741e+00, - 5.00777960220e+00, - 5.31832522463e+00, - 5.63405216435e+00, - 5.95566632680e+00, - 6.28401122877e+00, - 6.62011226264e+00, - 6.96524112055e+00, - 7.32101303278e+00, - 7.68954016404e+00, - 8.07368728501e+00, - 8.47752908338e+00, - 8.90724909996e+00, - 9.37315954965e+00, - 9.89528758683e+00, - 10.5261231680e+00 -}; +static const double gh_points[] = + { + // points 1 + 0.0, + // points 2 + -0.707106781186547524400844362105e+00, + 0.707106781186547524400844362105e+00, + // points 3 + -0.122474487139158904909864203735e+01, + 0.0e+00, + 0.122474487139158904909864203735e+01, + // points 4 + -0.165068012388578455588334111112e+01, + -0.524647623275290317884060253835e+00, + 0.524647623275290317884060253835e+00, + 0.165068012388578455588334111112e+01, + // points 5 + -0.202018287045608563292872408814e+01, + -0.958572464613818507112770593893e+00, + 0.0e+00, + 0.958572464613818507112770593893e+00, + 0.202018287045608563292872408814e+01, + // points 6 + -0.235060497367449222283392198706e+01, + -0.133584907401369694971489528297e+01, + -0.436077411927616508679215948251e+00, + 0.436077411927616508679215948251e+00, + 0.133584907401369694971489528297e+01, + 0.235060497367449222283392198706e+01, + // points 7 + -0.265196135683523349244708200652e+01, + -0.167355162876747144503180139830e+01, + -0.816287882858964663038710959027e+00, + 0.0e+00, + 0.816287882858964663038710959027e+00, + 0.167355162876747144503180139830e+01, + 0.265196135683523349244708200652e+01, + // points 8 + -0.293063742025724401922350270524e+01, + -0.198165675669584292585463063977e+01, + -0.115719371244678019472076577906e+01, + -0.381186990207322116854718885584e+00, + 0.381186990207322116854718885584e+00, + 0.115719371244678019472076577906e+01, + 0.198165675669584292585463063977e+01, + 0.293063742025724401922350270524e+01, + // points 9 + -0.319099320178152760723004779538e+01, + -0.226658058453184311180209693284e+01, + -0.146855328921666793166701573925e+01, + -0.723551018752837573322639864579e+00, + 0.0e+00, + 0.723551018752837573322639864579e+00, + 0.146855328921666793166701573925e+01, + 0.226658058453184311180209693284e+01, + 0.319099320178152760723004779538e+01, + // points 10 + -0.343615911883773760332672549432e+01, + -0.253273167423278979640896079775e+01, + -0.175668364929988177345140122011e+01, + -0.103661082978951365417749191676e+01, + -0.342901327223704608789165025557e+00, + 0.342901327223704608789165025557e+00, + 0.103661082978951365417749191676e+01, + 0.175668364929988177345140122011e+01, + 0.253273167423278979640896079775e+01, + 0.343615911883773760332672549432e+01, + // points 11 + -0.366847084655958251845837146485e+01, + -0.278329009978165177083671870152e+01, + -0.202594801582575533516591283121e+01, + -0.132655708449493285594973473558e+01, + -0.656809566882099765024611575383e+00, + 0.0e+00, + 0.656809566882099765024611575383e+00, + 0.132655708449493285594973473558e+01, + 0.202594801582575533516591283121e+01, + 0.278329009978165177083671870152e+01, + 0.366847084655958251845837146485e+01, + // points 12 + -0.388972489786978191927164274724e+01, + -0.302063702512088977171067937518e+01, + -0.227950708050105990018772856942e+01, + -0.159768263515260479670966277090e+01, + -0.947788391240163743704578131060e+00, + -0.314240376254359111276611634095e+00, + 0.314240376254359111276611634095e+00, + 0.947788391240163743704578131060e+00, + 0.159768263515260479670966277090e+01, + 0.227950708050105990018772856942e+01, + 0.302063702512088977171067937518e+01, + 0.388972489786978191927164274724e+01, + // points 13 + -0.410133759617863964117891508007e+01, + -0.324660897837240998812205115236e+01, + -0.251973568567823788343040913628e+01, + -0.185310765160151214200350644316e+01, + -0.122005503659074842622205526637e+01, + -0.605763879171060113080537108602e+00, + 0.0e+00, + 0.605763879171060113080537108602e+00, + 0.122005503659074842622205526637e+01, + 0.185310765160151214200350644316e+01, + 0.251973568567823788343040913628e+01, + 0.324660897837240998812205115236e+01, + 0.410133759617863964117891508007e+01, + // points 14 + -0.430444857047363181262129810037e+01, + -0.346265693360227055020891736115e+01, + -0.274847072498540256862499852415e+01, + -0.209518325850771681573497272630e+01, + -0.147668273114114087058350654421e+01, + -0.878713787329399416114679311861e+00, + -0.291745510672562078446113075799e+00, + 0.291745510672562078446113075799e+00, + 0.878713787329399416114679311861e+00, + 0.147668273114114087058350654421e+01, + 0.209518325850771681573497272630e+01, + 0.274847072498540256862499852415e+01, + 0.346265693360227055020891736115e+01, + 0.430444857047363181262129810037e+01, + // points 15 + -0.449999070730939155366438053053e+01, + -0.366995037340445253472922383312e+01, + -0.296716692790560324848896036355e+01, + -0.232573248617385774545404479449e+01, + -0.171999257518648893241583152515e+01, + -0.113611558521092066631913490556e+01, + -0.565069583255575748526020337198e+00, + 0.0e+00, + 0.565069583255575748526020337198e+00, + 0.113611558521092066631913490556e+01, + 0.171999257518648893241583152515e+01, + 0.232573248617385774545404479449e+01, + 0.296716692790560324848896036355e+01, + 0.366995037340445253472922383312e+01, + 0.449999070730939155366438053053e+01, + // points 16 + -0.468873893930581836468849864875e+01, + -0.386944790486012269871942409801e+01, + -0.317699916197995602681399455926e+01, + -0.254620215784748136215932870545e+01, + -0.195178799091625397743465541496e+01, + -0.138025853919888079637208966969e+01, + -0.822951449144655892582454496734e+00, + -0.273481046138152452158280401965e+00, + 0.273481046138152452158280401965e+00, + 0.822951449144655892582454496734e+00, + 0.138025853919888079637208966969e+01, + 0.195178799091625397743465541496e+01, + 0.254620215784748136215932870545e+01, + 0.317699916197995602681399455926e+01, + 0.386944790486012269871942409801e+01, + 0.468873893930581836468849864875e+01, + // points 17 + -0.487134519367440308834927655662e+01, + -0.406194667587547430689245559698e+01, + -0.337893209114149408338327069289e+01, + -0.275776291570388873092640349574e+01, + -0.217350282666662081927537907149e+01, + -0.161292431422123133311288254454e+01, + -0.106764872574345055363045773799e+01, + -0.531633001342654731349086553718e+00, + 0.0e+00, + 0.531633001342654731349086553718e+00, + 0.106764872574345055363045773799e+01, + 0.161292431422123133311288254454e+01, + 0.217350282666662081927537907149e+01, + 0.275776291570388873092640349574e+01, + 0.337893209114149408338327069289e+01, + 0.406194667587547430689245559698e+01, + 0.487134519367440308834927655662e+01, + // points 18 + -0.504836400887446676837203757885e+01, + -0.424811787356812646302342016090e+01, + -0.357376906848626607950067599377e+01, + -0.296137750553160684477863254906e+01, + -0.238629908916668600026459301424e+01, + -0.183553160426162889225383944409e+01, + -0.130092085838961736566626555439e+01, + -0.776682919267411661316659462284e+00, + -0.258267750519096759258116098711e+00, + 0.258267750519096759258116098711e+00, + 0.776682919267411661316659462284e+00, + 0.130092085838961736566626555439e+01, + 0.183553160426162889225383944409e+01, + 0.238629908916668600026459301424e+01, + 0.296137750553160684477863254906e+01, + 0.357376906848626607950067599377e+01, + 0.424811787356812646302342016090e+01, + 0.504836400887446676837203757885e+01, + // points 19 + -0.522027169053748216460967142500e+01, + -0.442853280660377943723498532226e+01, + -0.376218735196402009751489394104e+01, + -0.315784881834760228184318034120e+01, + -0.259113378979454256492128084112e+01, + -0.204923170985061937575050838669e+01, + -0.152417061939353303183354859367e+01, + -0.101036838713431135136859873726e+01, + -0.503520163423888209373811765050e+00, + 0.0e+00, + 0.503520163423888209373811765050e+00, + 0.101036838713431135136859873726e+01, + 0.152417061939353303183354859367e+01, + 0.204923170985061937575050838669e+01, + 0.259113378979454256492128084112e+01, + 0.315784881834760228184318034120e+01, + 0.376218735196402009751489394104e+01, + 0.442853280660377943723498532226e+01, + 0.522027169053748216460967142500e+01, + // points 20 + -0.538748089001123286201690041068e+01, + -0.460368244955074427307767524898e+01, + -0.394476404011562521037562880052e+01, + -0.334785456738321632691492452300e+01, + -0.278880605842813048052503375640e+01, + -0.225497400208927552308233334473e+01, + -0.173853771211658620678086566214e+01, + -0.123407621539532300788581834696e+01, + -0.737473728545394358705605144252e+00, + -0.245340708300901249903836530634e+00, + 0.245340708300901249903836530634e+00, + 0.737473728545394358705605144252e+00, + 0.123407621539532300788581834696e+01, + 0.173853771211658620678086566214e+01, + 0.225497400208927552308233334473e+01, + 0.278880605842813048052503375640e+01, + 0.334785456738321632691492452300e+01, + 0.394476404011562521037562880052e+01, + 0.460368244955074427307767524898e+01, + 0.538748089001123286201690041068e+01, + // points 30 + -6.86334529352989158106110835756e+00, + -6.13827922012393462039499237854e+00, + -5.53314715156749572511833355558e+00, + -4.98891896858994394448649710633e+00, + -4.48305535709251834188703761971e+00, + -4.00390860386122881522787601332e+00, + -3.54444387315534988692540090217e+00, + -3.09997052958644174868873332237e+00, + -2.66713212453561720057110646422e+00, + -2.24339146776150407247297999483e+00, + -1.82674114360368803883588048351e+00, + -1.41552780019818851194072510555e+00, + -1.00833827104672346180498960870e+00, + -0.603921058625552307778155678757e+00, + -0.201128576548871485545763013244e+00, + 0.201128576548871485545763013244e+00, + 0.603921058625552307778155678757e+00, + 1.00833827104672346180498960870e+00, + 1.41552780019818851194072510555e+00, + 1.82674114360368803883588048351e+00, + 2.24339146776150407247297999483e+00, + 2.66713212453561720057110646422e+00, + 3.09997052958644174868873332237e+00, + 3.54444387315534988692540090217e+00, + 4.00390860386122881522787601332e+00, + 4.48305535709251834188703761971e+00, + 4.98891896858994394448649710633e+00, + 5.53314715156749572511833355558e+00, + 6.13827922012393462039499237854e+00, + 6.86334529352989158106110835756e+00, + // points 32 + -7.12581390983e+00, + -6.40949814927e+00, + -5.81222594952e+00, + -5.27555098652e+00, + -4.77716450350e+00, + -4.30554795335e+00, + -3.85375548547e+00, + -3.41716749282e+00, + -2.99249082500e+00, + -2.57724953773e+00, + -2.16949918361e+00, + -1.76765410946e+00, + -1.37037641095e+00, + -0.976500463590e+00, + -0.584978765436e+00, + -0.194840741569e+00, + 0.194840741569e+00, + 0.584978765436e+00, + 0.976500463590e+00, + 1.37037641095e+00, + 1.76765410946e+00, + 2.16949918361e+00, + 2.57724953773e+00, + 2.99249082500e+00, + 3.41716749282e+00, + 3.85375548547e+00, + 4.30554795335e+00, + 4.77716450350e+00, + 5.27555098652e+00, + 5.81222594952e+00, + 6.40949814927e+00, + 7.12581390983e+00, + // points 40 + -8.09876113925e+00, + -7.41158253149e+00, + -6.84023730525e+00, + -6.32825535122e+00, + -5.85409505603e+00, + -5.40665424797e+00, + -4.97926097855e+00, + -4.56750207284e+00, + -4.16825706683e+00, + -3.77920675344e+00, + -3.39855826586e+00, + -3.02487988390e+00, + -2.65699599844e+00, + -2.29391714188e+00, + -1.93479147228e+00, + -1.57886989493e+00, + -1.22548010905e+00, + -0.874006612357e+00, + -0.523874713832e+00, + -0.174537214598e+00, + 0.174537214598e+00, + 0.523874713832e+00, + 0.874006612357e+00, + 1.22548010905e+00, + 1.57886989493e+00, + 1.93479147228e+00, + 2.29391714188e+00, + 2.65699599844e+00, + 3.02487988390e+00, + 3.39855826586e+00, + 3.77920675344e+00, + 4.16825706683e+00, + 4.56750207284e+00, + 4.97926097855e+00, + 5.40665424797e+00, + 5.85409505603e+00, + 6.32825535122e+00, + 6.84023730525e+00, + 7.41158253149e+00, + 8.09876113925e+00, + // points 50 + -9.18240695813e+00, + -8.52277103092e+00, + -7.97562236821e+00, + -7.48640942986e+00, + -7.03432350977e+00, + -6.60864797386e+00, + -6.20295251927e+00, + -5.81299467542e+00, + -5.43578608722e+00, + -5.06911758492e+00, + -4.71129366617e+00, + -4.36097316045e+00, + -4.01706817286e+00, + -3.67867706252e+00, + -3.34503831394e+00, + -3.01549776957e+00, + -2.68948470227e+00, + -2.36649390430e+00, + -2.04607196869e+00, + -1.72780654752e+00, + -1.41131775490e+00, + -1.09625112896e+00, + -0.782271729555e+00, + -0.469059056678e+00, + -0.156302546889e+00, + 0.156302546889e+00, + 0.469059056678e+00, + 0.782271729555e+00, + 1.09625112896e+00, + 1.41131775490e+00, + 1.72780654752e+00, + 2.04607196869e+00, + 2.36649390430e+00, + 2.68948470227e+00, + 3.01549776957e+00, + 3.34503831394e+00, + 3.67867706252e+00, + 4.01706817286e+00, + 4.36097316045e+00, + 4.71129366617e+00, + 5.06911758492e+00, + 5.43578608722e+00, + 5.81299467542e+00, + 6.20295251927e+00, + 6.60864797386e+00, + 7.03432350977e+00, + 7.48640942986e+00, + 7.97562236821e+00, + 8.52277103092e+00, + 9.18240695813e+00, + // points 60 + -10.1591092462e+00, + -9.52090367701e+00, + -8.99239800140e+00, + -8.52056928412e+00, + -8.08518865425e+00, + -7.67583993750e+00, + -7.28627659440e+00, + -6.91238153219e+00, + -6.55125916706e+00, + -6.20077355799e+00, + -5.85929019639e+00, + -5.52552108614e+00, + -5.19842653458e+00, + -4.87715007747e+00, + -4.56097375794e+00, + -4.24928643596e+00, + -3.94156073393e+00, + -3.63733587617e+00, + -3.33620465355e+00, + -3.03780333823e+00, + -2.74180374807e+00, + -2.44790690231e+00, + -2.15583787123e+00, + -1.86534153123e+00, + -1.57617901198e+00, + -1.28812467487e+00, + -1.00096349956e+00, + -0.714488781673e+00, + -0.428500064221e+00, + -0.142801238703e+00, + 0.142801238703e+00, + 0.428500064221e+00, + 0.714488781673e+00, + 1.00096349956e+00, + 1.28812467487e+00, + 1.57617901198e+00, + 1.86534153123e+00, + 2.15583787123e+00, + 2.44790690231e+00, + 2.74180374807e+00, + 3.03780333823e+00, + 3.33620465355e+00, + 3.63733587617e+00, + 3.94156073393e+00, + 4.24928643596e+00, + 4.56097375794e+00, + 4.87715007747e+00, + 5.19842653458e+00, + 5.52552108614e+00, + 5.85929019639e+00, + 6.20077355799e+00, + 6.55125916706e+00, + 6.91238153219e+00, + 7.28627659440e+00, + 7.67583993750e+00, + 8.08518865425e+00, + 8.52056928412e+00, + 8.99239800140e+00, + 9.52090367701e+00, + 10.1591092462e+00, + // points 64 + -10.5261231680e+00, + -9.89528758683e+00, + -9.37315954965e+00, + -8.90724909996e+00, + -8.47752908338e+00, + -8.07368728501e+00, + -7.68954016404e+00, + -7.32101303278e+00, + -6.96524112055e+00, + -6.62011226264e+00, + -6.28401122877e+00, + -5.95566632680e+00, + -5.63405216435e+00, + -5.31832522463e+00, + -5.00777960220e+00, + -4.70181564741e+00, + -4.39991716823e+00, + -4.10163447457e+00, + -3.80657151395e+00, + -3.51437593574e+00, + -3.22473129199e+00, + -2.93735082300e+00, + -2.65197243543e+00, + -2.36835458863e+00, + -2.08627287988e+00, + -1.80551717147e+00, + -1.52588914021e+00, + -1.24720015694e+00, + -0.969269423071e+00, + -0.691922305810e+00, + -0.414988824121e+00, + -0.138302244987e+00, + 0.138302244987e+00, + 0.414988824121e+00, + 0.691922305810e+00, + 0.969269423071e+00, + 1.24720015694e+00, + 1.52588914021e+00, + 1.80551717147e+00, + 2.08627287988e+00, + 2.36835458863e+00, + 2.65197243543e+00, + 2.93735082300e+00, + 3.22473129199e+00, + 3.51437593574e+00, + 3.80657151395e+00, + 4.10163447457e+00, + 4.39991716823e+00, + 4.70181564741e+00, + 5.00777960220e+00, + 5.31832522463e+00, + 5.63405216435e+00, + 5.95566632680e+00, + 6.28401122877e+00, + 6.62011226264e+00, + 6.96524112055e+00, + 7.32101303278e+00, + 7.68954016404e+00, + 8.07368728501e+00, + 8.47752908338e+00, + 8.90724909996e+00, + 9.37315954965e+00, + 9.89528758683e+00, + 10.5261231680e+00 + }; // Gauss-Legendre quadrature; prefix gl @@ -1072,671 +1075,674 @@ static const double gh_points[] = { static const int gl_num_levels = 22; // Number of points in each level -static const int gl_num_points[] = { - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 32, 64 -}; +static const int gl_num_points[] = + { + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 32, 64 + }; // Weights, starting with the first level -static const double gl_weights[] = { - // weight 1 - 2.0e+00, - // weights 2 - 1.0e+00, - 1.0e+00, - // weights 3 - 0.555555555555555555555555555555e+00, - 0.888888888888888888888888888888e+00, - 0.555555555555555555555555555555e+00, - // weights 4 - 0.347854845137453857373063949222e+00, - 0.652145154862546142626936050778e+00, - 0.652145154862546142626936050778e+00, - 0.347854845137453857373063949222e+00, - // weights 5 - 0.236926885056189087514264040720e+00, - 0.478628670499366468041291514836e+00, - 0.568888888888888888888888888889e+00, - 0.478628670499366468041291514836e+00, - 0.236926885056189087514264040720e+00, - // weights 6 - 0.171324492379170345040296142173e+00, - 0.360761573048138607569833513838e+00, - 0.467913934572691047389870343990e+00, - 0.467913934572691047389870343990e+00, - 0.360761573048138607569833513838e+00, - 0.171324492379170345040296142173e+00, - // weights 7 - 0.129484966168869693270611432679e+00, - 0.279705391489276667901467771424e+00, - 0.381830050505118944950369775489e+00, - 0.417959183673469387755102040816e+00, - 0.381830050505118944950369775489e+00, - 0.279705391489276667901467771424e+00, - 0.129484966168869693270611432679e+00, - // weights 8 - 0.101228536290376259152531354310e+00, - 0.222381034453374470544355994426e+00, - 0.313706645877887287337962201987e+00, - 0.362683783378361982965150449277e+00, - 0.362683783378361982965150449277e+00, - 0.313706645877887287337962201987e+00, - 0.222381034453374470544355994426e+00, - 0.101228536290376259152531354310e+00, - // weights 9 - 0.812743883615744119718921581105e-01, - 0.180648160694857404058472031243e+00, - 0.260610696402935462318742869419e+00, - 0.312347077040002840068630406584e+00, - 0.330239355001259763164525069287e+00, - 0.312347077040002840068630406584e+00, - 0.260610696402935462318742869419e+00, - 0.180648160694857404058472031243e+00, - 0.812743883615744119718921581105e-01, - // weights 10 - 0.666713443086881375935688098933e-01, - 0.149451349150580593145776339658e+00, - 0.219086362515982043995534934228e+00, - 0.269266719309996355091226921569e+00, - 0.295524224714752870173892994651e+00, - 0.295524224714752870173892994651e+00, - 0.269266719309996355091226921569e+00, - 0.219086362515982043995534934228e+00, - 0.149451349150580593145776339658e+00, - 0.666713443086881375935688098933e-01, - // weights 11 - 0.556685671161736664827537204425e-01, - 0.125580369464904624634694299224e+00, - 0.186290210927734251426097641432e+00, - 0.233193764591990479918523704843e+00, - 0.262804544510246662180688869891e+00, - 0.272925086777900630714483528336e+00, - 0.262804544510246662180688869891e+00, - 0.233193764591990479918523704843e+00, - 0.186290210927734251426097641432e+00, - 0.125580369464904624634694299224e+00, - 0.556685671161736664827537204425e-01, - // weights 12 - 0.471753363865118271946159614850e-01, - 0.106939325995318430960254718194e+00, - 0.160078328543346226334652529543e+00, - 0.203167426723065921749064455810e+00, - 0.233492536538354808760849898925e+00, - 0.249147045813402785000562436043e+00, - 0.249147045813402785000562436043e+00, - 0.233492536538354808760849898925e+00, - 0.203167426723065921749064455810e+00, - 0.160078328543346226334652529543e+00, - 0.106939325995318430960254718194e+00, - 0.471753363865118271946159614850e-01, - // weights 13 - 0.404840047653158795200215922010e-01, - 0.921214998377284479144217759538e-01, - 0.138873510219787238463601776869e+00, - 0.178145980761945738280046691996e+00, - 0.207816047536888502312523219306e+00, - 0.226283180262897238412090186040e+00, - 0.232551553230873910194589515269e+00, - 0.226283180262897238412090186040e+00, - 0.207816047536888502312523219306e+00, - 0.178145980761945738280046691996e+00, - 0.138873510219787238463601776869e+00, - 0.921214998377284479144217759538e-01, - 0.404840047653158795200215922010e-01, - // weights 14 - 0.351194603317518630318328761382e-01, - 0.801580871597602098056332770629e-01, - 0.121518570687903184689414809072e+00, - 0.157203167158193534569601938624e+00, - 0.185538397477937813741716590125e+00, - 0.205198463721295603965924065661e+00, - 0.215263853463157790195876443316e+00, - 0.215263853463157790195876443316e+00, - 0.205198463721295603965924065661e+00, - 0.185538397477937813741716590125e+00, - 0.157203167158193534569601938624e+00, - 0.121518570687903184689414809072e+00, - 0.801580871597602098056332770629e-01, - 0.351194603317518630318328761382e-01, - // weights 15 - 0.307532419961172683546283935772e-01, - 0.703660474881081247092674164507e-01, - 0.107159220467171935011869546686e+00, - 0.139570677926154314447804794511e+00, - 0.166269205816993933553200860481e+00, - 0.186161000015562211026800561866e+00, - 0.198431485327111576456118326444e+00, - 0.202578241925561272880620199968e+00, - 0.198431485327111576456118326444e+00, - 0.186161000015562211026800561866e+00, - 0.166269205816993933553200860481e+00, - 0.139570677926154314447804794511e+00, - 0.107159220467171935011869546686e+00, - 0.703660474881081247092674164507e-01, - 0.307532419961172683546283935772e-01, - // weights 16 - 0.271524594117540948517805724560e-01, - 0.622535239386478928628438369944e-01, - 0.951585116824927848099251076022e-01, - 0.124628971255533872052476282192e+00, - 0.149595988816576732081501730547e+00, - 0.169156519395002538189312079030e+00, - 0.182603415044923588866763667969e+00, - 0.189450610455068496285396723208e+00, - 0.189450610455068496285396723208e+00, - 0.182603415044923588866763667969e+00, - 0.169156519395002538189312079030e+00, - 0.149595988816576732081501730547e+00, - 0.124628971255533872052476282192e+00, - 0.951585116824927848099251076022e-01, - 0.622535239386478928628438369944e-01, - 0.271524594117540948517805724560e-01, - // weights 17 - 0.241483028685479319601100262876e-01, - 0.554595293739872011294401653582e-01, - 0.850361483171791808835353701911e-01, - 0.111883847193403971094788385626e+00, - 0.135136368468525473286319981702e+00, - 0.154045761076810288081431594802e+00, - 0.168004102156450044509970663788e+00, - 0.176562705366992646325270990113e+00, - 0.179446470356206525458265644262e+00, - 0.176562705366992646325270990113e+00, - 0.168004102156450044509970663788e+00, - 0.154045761076810288081431594802e+00, - 0.135136368468525473286319981702e+00, - 0.111883847193403971094788385626e+00, - 0.850361483171791808835353701911e-01, - 0.554595293739872011294401653582e-01, - 0.241483028685479319601100262876e-01, - // weights 18 - 0.216160135264833103133427102665e-01, - 0.497145488949697964533349462026e-01, - 0.764257302548890565291296776166e-01, - 0.100942044106287165562813984925e+00, - 0.122555206711478460184519126800e+00, - 0.140642914670650651204731303752e+00, - 0.154684675126265244925418003836e+00, - 0.164276483745832722986053776466e+00, - 0.169142382963143591840656470135e+00, - 0.169142382963143591840656470135e+00, - 0.164276483745832722986053776466e+00, - 0.154684675126265244925418003836e+00, - 0.140642914670650651204731303752e+00, - 0.122555206711478460184519126800e+00, - 0.100942044106287165562813984925e+00, - 0.764257302548890565291296776166e-01, - 0.497145488949697964533349462026e-01, - 0.216160135264833103133427102665e-01, - // weights 19 - 0.194617882297264770363120414644e-01, - 0.448142267656996003328381574020e-01, - 0.690445427376412265807082580060e-01, - 0.914900216224499994644620941238e-01, - 0.111566645547333994716023901682e+00, - 0.128753962539336227675515784857e+00, - 0.142606702173606611775746109442e+00, - 0.152766042065859666778855400898e+00, - 0.158968843393954347649956439465e+00, - 0.161054449848783695979163625321e+00, - 0.158968843393954347649956439465e+00, - 0.152766042065859666778855400898e+00, - 0.142606702173606611775746109442e+00, - 0.128753962539336227675515784857e+00, - 0.111566645547333994716023901682e+00, - 0.914900216224499994644620941238e-01, - 0.690445427376412265807082580060e-01, - 0.448142267656996003328381574020e-01, - 0.194617882297264770363120414644e-01, - // weights 20 - 0.176140071391521183118619623519e-01, - 0.406014298003869413310399522749e-01, - 0.626720483341090635695065351870e-01, - 0.832767415767047487247581432220e-01, - 0.101930119817240435036750135480e+00, - 0.118194531961518417312377377711e+00, - 0.131688638449176626898494499748e+00, - 0.142096109318382051329298325067e+00, - 0.149172986472603746787828737002e+00, - 0.152753387130725850698084331955e+00, - 0.152753387130725850698084331955e+00, - 0.149172986472603746787828737002e+00, - 0.142096109318382051329298325067e+00, - 0.131688638449176626898494499748e+00, - 0.118194531961518417312377377711e+00, - 0.101930119817240435036750135480e+00, - 0.832767415767047487247581432220e-01, - 0.626720483341090635695065351870e-01, - 0.406014298003869413310399522749e-01, - 0.176140071391521183118619623519e-01, - // weights 32 - 0.701861000947009660040706373885e-02, - 0.162743947309056706051705622064e-01, - 0.253920653092620594557525897892e-01, - 0.342738629130214331026877322524e-01, - 0.428358980222266806568786466061e-01, - 0.509980592623761761961632446895e-01, - 0.586840934785355471452836373002e-01, - 0.658222227763618468376500637069e-01, - 0.723457941088485062253993564785e-01, - 0.781938957870703064717409188283e-01, - 0.833119242269467552221990746043e-01, - 0.876520930044038111427714627518e-01, - 0.911738786957638847128685771116e-01, - 0.938443990808045656391802376681e-01, - 0.956387200792748594190820022041e-01, - 0.965400885147278005667648300636e-01, - 0.965400885147278005667648300636e-01, - 0.956387200792748594190820022041e-01, - 0.938443990808045656391802376681e-01, - 0.911738786957638847128685771116e-01, - 0.876520930044038111427714627518e-01, - 0.833119242269467552221990746043e-01, - 0.781938957870703064717409188283e-01, - 0.723457941088485062253993564785e-01, - 0.658222227763618468376500637069e-01, - 0.586840934785355471452836373002e-01, - 0.509980592623761761961632446895e-01, - 0.428358980222266806568786466061e-01, - 0.342738629130214331026877322524e-01, - 0.253920653092620594557525897892e-01, - 0.162743947309056706051705622064e-01, - 0.701861000947009660040706373885e-02, - // weights 64 - 0.178328072169643294729607914497e-02, - 0.414703326056246763528753572855e-02, - 0.650445796897836285611736039998e-02, - 0.884675982636394772303091465973e-02, - 0.111681394601311288185904930192e-01, - 0.134630478967186425980607666860e-01, - 0.157260304760247193219659952975e-01, - 0.179517157756973430850453020011e-01, - 0.201348231535302093723403167285e-01, - 0.222701738083832541592983303842e-01, - 0.243527025687108733381775504091e-01, - 0.263774697150546586716917926252e-01, - 0.283396726142594832275113052002e-01, - 0.302346570724024788679740598195e-01, - 0.320579283548515535854675043479e-01, - 0.338051618371416093915654821107e-01, - 0.354722132568823838106931467152e-01, - 0.370551285402400460404151018096e-01, - 0.385501531786156291289624969468e-01, - 0.399537411327203413866569261283e-01, - 0.412625632426235286101562974736e-01, - 0.424735151236535890073397679088e-01, - 0.435837245293234533768278609737e-01, - 0.445905581637565630601347100309e-01, - 0.454916279274181444797709969713e-01, - 0.462847965813144172959532492323e-01, - 0.469681828162100173253262857546e-01, - 0.475401657148303086622822069442e-01, - 0.479993885964583077281261798713e-01, - 0.483447622348029571697695271580e-01, - 0.485754674415034269347990667840e-01, - 0.486909570091397203833653907347e-01, - 0.486909570091397203833653907347e-01, - 0.485754674415034269347990667840e-01, - 0.483447622348029571697695271580e-01, - 0.479993885964583077281261798713e-01, - 0.475401657148303086622822069442e-01, - 0.469681828162100173253262857546e-01, - 0.462847965813144172959532492323e-01, - 0.454916279274181444797709969713e-01, - 0.445905581637565630601347100309e-01, - 0.435837245293234533768278609737e-01, - 0.424735151236535890073397679088e-01, - 0.412625632426235286101562974736e-01, - 0.399537411327203413866569261283e-01, - 0.385501531786156291289624969468e-01, - 0.370551285402400460404151018096e-01, - 0.354722132568823838106931467152e-01, - 0.338051618371416093915654821107e-01, - 0.320579283548515535854675043479e-01, - 0.302346570724024788679740598195e-01, - 0.283396726142594832275113052002e-01, - 0.263774697150546586716917926252e-01, - 0.243527025687108733381775504091e-01, - 0.222701738083832541592983303842e-01, - 0.201348231535302093723403167285e-01, - 0.179517157756973430850453020011e-01, - 0.157260304760247193219659952975e-01, - 0.134630478967186425980607666860e-01, - 0.111681394601311288185904930192e-01, - 0.884675982636394772303091465973e-02, - 0.650445796897836285611736039998e-02, - 0.414703326056246763528753572855e-02, - 0.178328072169643294729607914497e-02 -}; +static const double gl_weights[] = + { + // weight 1 + 2.0e+00, + // weights 2 + 1.0e+00, + 1.0e+00, + // weights 3 + 0.555555555555555555555555555555e+00, + 0.888888888888888888888888888888e+00, + 0.555555555555555555555555555555e+00, + // weights 4 + 0.347854845137453857373063949222e+00, + 0.652145154862546142626936050778e+00, + 0.652145154862546142626936050778e+00, + 0.347854845137453857373063949222e+00, + // weights 5 + 0.236926885056189087514264040720e+00, + 0.478628670499366468041291514836e+00, + 0.568888888888888888888888888889e+00, + 0.478628670499366468041291514836e+00, + 0.236926885056189087514264040720e+00, + // weights 6 + 0.171324492379170345040296142173e+00, + 0.360761573048138607569833513838e+00, + 0.467913934572691047389870343990e+00, + 0.467913934572691047389870343990e+00, + 0.360761573048138607569833513838e+00, + 0.171324492379170345040296142173e+00, + // weights 7 + 0.129484966168869693270611432679e+00, + 0.279705391489276667901467771424e+00, + 0.381830050505118944950369775489e+00, + 0.417959183673469387755102040816e+00, + 0.381830050505118944950369775489e+00, + 0.279705391489276667901467771424e+00, + 0.129484966168869693270611432679e+00, + // weights 8 + 0.101228536290376259152531354310e+00, + 0.222381034453374470544355994426e+00, + 0.313706645877887287337962201987e+00, + 0.362683783378361982965150449277e+00, + 0.362683783378361982965150449277e+00, + 0.313706645877887287337962201987e+00, + 0.222381034453374470544355994426e+00, + 0.101228536290376259152531354310e+00, + // weights 9 + 0.812743883615744119718921581105e-01, + 0.180648160694857404058472031243e+00, + 0.260610696402935462318742869419e+00, + 0.312347077040002840068630406584e+00, + 0.330239355001259763164525069287e+00, + 0.312347077040002840068630406584e+00, + 0.260610696402935462318742869419e+00, + 0.180648160694857404058472031243e+00, + 0.812743883615744119718921581105e-01, + // weights 10 + 0.666713443086881375935688098933e-01, + 0.149451349150580593145776339658e+00, + 0.219086362515982043995534934228e+00, + 0.269266719309996355091226921569e+00, + 0.295524224714752870173892994651e+00, + 0.295524224714752870173892994651e+00, + 0.269266719309996355091226921569e+00, + 0.219086362515982043995534934228e+00, + 0.149451349150580593145776339658e+00, + 0.666713443086881375935688098933e-01, + // weights 11 + 0.556685671161736664827537204425e-01, + 0.125580369464904624634694299224e+00, + 0.186290210927734251426097641432e+00, + 0.233193764591990479918523704843e+00, + 0.262804544510246662180688869891e+00, + 0.272925086777900630714483528336e+00, + 0.262804544510246662180688869891e+00, + 0.233193764591990479918523704843e+00, + 0.186290210927734251426097641432e+00, + 0.125580369464904624634694299224e+00, + 0.556685671161736664827537204425e-01, + // weights 12 + 0.471753363865118271946159614850e-01, + 0.106939325995318430960254718194e+00, + 0.160078328543346226334652529543e+00, + 0.203167426723065921749064455810e+00, + 0.233492536538354808760849898925e+00, + 0.249147045813402785000562436043e+00, + 0.249147045813402785000562436043e+00, + 0.233492536538354808760849898925e+00, + 0.203167426723065921749064455810e+00, + 0.160078328543346226334652529543e+00, + 0.106939325995318430960254718194e+00, + 0.471753363865118271946159614850e-01, + // weights 13 + 0.404840047653158795200215922010e-01, + 0.921214998377284479144217759538e-01, + 0.138873510219787238463601776869e+00, + 0.178145980761945738280046691996e+00, + 0.207816047536888502312523219306e+00, + 0.226283180262897238412090186040e+00, + 0.232551553230873910194589515269e+00, + 0.226283180262897238412090186040e+00, + 0.207816047536888502312523219306e+00, + 0.178145980761945738280046691996e+00, + 0.138873510219787238463601776869e+00, + 0.921214998377284479144217759538e-01, + 0.404840047653158795200215922010e-01, + // weights 14 + 0.351194603317518630318328761382e-01, + 0.801580871597602098056332770629e-01, + 0.121518570687903184689414809072e+00, + 0.157203167158193534569601938624e+00, + 0.185538397477937813741716590125e+00, + 0.205198463721295603965924065661e+00, + 0.215263853463157790195876443316e+00, + 0.215263853463157790195876443316e+00, + 0.205198463721295603965924065661e+00, + 0.185538397477937813741716590125e+00, + 0.157203167158193534569601938624e+00, + 0.121518570687903184689414809072e+00, + 0.801580871597602098056332770629e-01, + 0.351194603317518630318328761382e-01, + // weights 15 + 0.307532419961172683546283935772e-01, + 0.703660474881081247092674164507e-01, + 0.107159220467171935011869546686e+00, + 0.139570677926154314447804794511e+00, + 0.166269205816993933553200860481e+00, + 0.186161000015562211026800561866e+00, + 0.198431485327111576456118326444e+00, + 0.202578241925561272880620199968e+00, + 0.198431485327111576456118326444e+00, + 0.186161000015562211026800561866e+00, + 0.166269205816993933553200860481e+00, + 0.139570677926154314447804794511e+00, + 0.107159220467171935011869546686e+00, + 0.703660474881081247092674164507e-01, + 0.307532419961172683546283935772e-01, + // weights 16 + 0.271524594117540948517805724560e-01, + 0.622535239386478928628438369944e-01, + 0.951585116824927848099251076022e-01, + 0.124628971255533872052476282192e+00, + 0.149595988816576732081501730547e+00, + 0.169156519395002538189312079030e+00, + 0.182603415044923588866763667969e+00, + 0.189450610455068496285396723208e+00, + 0.189450610455068496285396723208e+00, + 0.182603415044923588866763667969e+00, + 0.169156519395002538189312079030e+00, + 0.149595988816576732081501730547e+00, + 0.124628971255533872052476282192e+00, + 0.951585116824927848099251076022e-01, + 0.622535239386478928628438369944e-01, + 0.271524594117540948517805724560e-01, + // weights 17 + 0.241483028685479319601100262876e-01, + 0.554595293739872011294401653582e-01, + 0.850361483171791808835353701911e-01, + 0.111883847193403971094788385626e+00, + 0.135136368468525473286319981702e+00, + 0.154045761076810288081431594802e+00, + 0.168004102156450044509970663788e+00, + 0.176562705366992646325270990113e+00, + 0.179446470356206525458265644262e+00, + 0.176562705366992646325270990113e+00, + 0.168004102156450044509970663788e+00, + 0.154045761076810288081431594802e+00, + 0.135136368468525473286319981702e+00, + 0.111883847193403971094788385626e+00, + 0.850361483171791808835353701911e-01, + 0.554595293739872011294401653582e-01, + 0.241483028685479319601100262876e-01, + // weights 18 + 0.216160135264833103133427102665e-01, + 0.497145488949697964533349462026e-01, + 0.764257302548890565291296776166e-01, + 0.100942044106287165562813984925e+00, + 0.122555206711478460184519126800e+00, + 0.140642914670650651204731303752e+00, + 0.154684675126265244925418003836e+00, + 0.164276483745832722986053776466e+00, + 0.169142382963143591840656470135e+00, + 0.169142382963143591840656470135e+00, + 0.164276483745832722986053776466e+00, + 0.154684675126265244925418003836e+00, + 0.140642914670650651204731303752e+00, + 0.122555206711478460184519126800e+00, + 0.100942044106287165562813984925e+00, + 0.764257302548890565291296776166e-01, + 0.497145488949697964533349462026e-01, + 0.216160135264833103133427102665e-01, + // weights 19 + 0.194617882297264770363120414644e-01, + 0.448142267656996003328381574020e-01, + 0.690445427376412265807082580060e-01, + 0.914900216224499994644620941238e-01, + 0.111566645547333994716023901682e+00, + 0.128753962539336227675515784857e+00, + 0.142606702173606611775746109442e+00, + 0.152766042065859666778855400898e+00, + 0.158968843393954347649956439465e+00, + 0.161054449848783695979163625321e+00, + 0.158968843393954347649956439465e+00, + 0.152766042065859666778855400898e+00, + 0.142606702173606611775746109442e+00, + 0.128753962539336227675515784857e+00, + 0.111566645547333994716023901682e+00, + 0.914900216224499994644620941238e-01, + 0.690445427376412265807082580060e-01, + 0.448142267656996003328381574020e-01, + 0.194617882297264770363120414644e-01, + // weights 20 + 0.176140071391521183118619623519e-01, + 0.406014298003869413310399522749e-01, + 0.626720483341090635695065351870e-01, + 0.832767415767047487247581432220e-01, + 0.101930119817240435036750135480e+00, + 0.118194531961518417312377377711e+00, + 0.131688638449176626898494499748e+00, + 0.142096109318382051329298325067e+00, + 0.149172986472603746787828737002e+00, + 0.152753387130725850698084331955e+00, + 0.152753387130725850698084331955e+00, + 0.149172986472603746787828737002e+00, + 0.142096109318382051329298325067e+00, + 0.131688638449176626898494499748e+00, + 0.118194531961518417312377377711e+00, + 0.101930119817240435036750135480e+00, + 0.832767415767047487247581432220e-01, + 0.626720483341090635695065351870e-01, + 0.406014298003869413310399522749e-01, + 0.176140071391521183118619623519e-01, + // weights 32 + 0.701861000947009660040706373885e-02, + 0.162743947309056706051705622064e-01, + 0.253920653092620594557525897892e-01, + 0.342738629130214331026877322524e-01, + 0.428358980222266806568786466061e-01, + 0.509980592623761761961632446895e-01, + 0.586840934785355471452836373002e-01, + 0.658222227763618468376500637069e-01, + 0.723457941088485062253993564785e-01, + 0.781938957870703064717409188283e-01, + 0.833119242269467552221990746043e-01, + 0.876520930044038111427714627518e-01, + 0.911738786957638847128685771116e-01, + 0.938443990808045656391802376681e-01, + 0.956387200792748594190820022041e-01, + 0.965400885147278005667648300636e-01, + 0.965400885147278005667648300636e-01, + 0.956387200792748594190820022041e-01, + 0.938443990808045656391802376681e-01, + 0.911738786957638847128685771116e-01, + 0.876520930044038111427714627518e-01, + 0.833119242269467552221990746043e-01, + 0.781938957870703064717409188283e-01, + 0.723457941088485062253993564785e-01, + 0.658222227763618468376500637069e-01, + 0.586840934785355471452836373002e-01, + 0.509980592623761761961632446895e-01, + 0.428358980222266806568786466061e-01, + 0.342738629130214331026877322524e-01, + 0.253920653092620594557525897892e-01, + 0.162743947309056706051705622064e-01, + 0.701861000947009660040706373885e-02, + // weights 64 + 0.178328072169643294729607914497e-02, + 0.414703326056246763528753572855e-02, + 0.650445796897836285611736039998e-02, + 0.884675982636394772303091465973e-02, + 0.111681394601311288185904930192e-01, + 0.134630478967186425980607666860e-01, + 0.157260304760247193219659952975e-01, + 0.179517157756973430850453020011e-01, + 0.201348231535302093723403167285e-01, + 0.222701738083832541592983303842e-01, + 0.243527025687108733381775504091e-01, + 0.263774697150546586716917926252e-01, + 0.283396726142594832275113052002e-01, + 0.302346570724024788679740598195e-01, + 0.320579283548515535854675043479e-01, + 0.338051618371416093915654821107e-01, + 0.354722132568823838106931467152e-01, + 0.370551285402400460404151018096e-01, + 0.385501531786156291289624969468e-01, + 0.399537411327203413866569261283e-01, + 0.412625632426235286101562974736e-01, + 0.424735151236535890073397679088e-01, + 0.435837245293234533768278609737e-01, + 0.445905581637565630601347100309e-01, + 0.454916279274181444797709969713e-01, + 0.462847965813144172959532492323e-01, + 0.469681828162100173253262857546e-01, + 0.475401657148303086622822069442e-01, + 0.479993885964583077281261798713e-01, + 0.483447622348029571697695271580e-01, + 0.485754674415034269347990667840e-01, + 0.486909570091397203833653907347e-01, + 0.486909570091397203833653907347e-01, + 0.485754674415034269347990667840e-01, + 0.483447622348029571697695271580e-01, + 0.479993885964583077281261798713e-01, + 0.475401657148303086622822069442e-01, + 0.469681828162100173253262857546e-01, + 0.462847965813144172959532492323e-01, + 0.454916279274181444797709969713e-01, + 0.445905581637565630601347100309e-01, + 0.435837245293234533768278609737e-01, + 0.424735151236535890073397679088e-01, + 0.412625632426235286101562974736e-01, + 0.399537411327203413866569261283e-01, + 0.385501531786156291289624969468e-01, + 0.370551285402400460404151018096e-01, + 0.354722132568823838106931467152e-01, + 0.338051618371416093915654821107e-01, + 0.320579283548515535854675043479e-01, + 0.302346570724024788679740598195e-01, + 0.283396726142594832275113052002e-01, + 0.263774697150546586716917926252e-01, + 0.243527025687108733381775504091e-01, + 0.222701738083832541592983303842e-01, + 0.201348231535302093723403167285e-01, + 0.179517157756973430850453020011e-01, + 0.157260304760247193219659952975e-01, + 0.134630478967186425980607666860e-01, + 0.111681394601311288185904930192e-01, + 0.884675982636394772303091465973e-02, + 0.650445796897836285611736039998e-02, + 0.414703326056246763528753572855e-02, + 0.178328072169643294729607914497e-02 + }; // Points, starting with the first level -static const double gl_points[] = { - // points 1 - 0.0e+00, - // points 2 - -0.577350269189625764509148780502e+00, - 0.577350269189625764509148780502e+00, - // points 3 - -0.774596669241483377035853079956e+00, - 0.0e+00, - 0.774596669241483377035853079956e+00, - // points 4 - -0.861136311594052575223946488893e+00, - -0.339981043584856264802665759103e+00, - 0.339981043584856264802665759103e+00, - 0.861136311594052575223946488893e+00, - // points 5 - -0.906179845938663992797626878299e+00, - -0.538469310105683091036314420700e+00, - 0.0e+00, - 0.538469310105683091036314420700e+00, - 0.906179845938663992797626878299e+00, - // points 6 - -0.932469514203152027812301554494e+00, - -0.661209386466264513661399595020e+00, - -0.238619186083196908630501721681e+00, - 0.238619186083196908630501721681e+00, - 0.661209386466264513661399595020e+00, - 0.932469514203152027812301554494e+00, - // points 7 - -0.949107912342758524526189684048e+00, - -0.741531185599394439863864773281e+00, - -0.405845151377397166906606412077e+00, - 0.0e+00, - 0.405845151377397166906606412077e+00, - 0.741531185599394439863864773281e+00, - 0.949107912342758524526189684048e+00, - // points 8 - -0.960289856497536231683560868569e+00, - -0.796666477413626739591553936476e+00, - -0.525532409916328985817739049189e+00, - -0.183434642495649804939476142360e+00, - 0.183434642495649804939476142360e+00, - 0.525532409916328985817739049189e+00, - 0.796666477413626739591553936476e+00, - 0.960289856497536231683560868569e+00, - // points 9 - -0.968160239507626089835576202904e+00, - -0.836031107326635794299429788070e+00, - -0.613371432700590397308702039341e+00, - -0.324253423403808929038538014643e+00, - 0.0e+00, - 0.324253423403808929038538014643e+00, - 0.613371432700590397308702039341e+00, - 0.836031107326635794299429788070e+00, - 0.968160239507626089835576202904e+00, - // points 10 - -0.973906528517171720077964012084e+00, - -0.865063366688984510732096688423e+00, - -0.679409568299024406234327365115e+00, - -0.433395394129247190799265943166e+00, - -0.148874338981631210884826001130e+00, - 0.148874338981631210884826001130e+00, - 0.433395394129247190799265943166e+00, - 0.679409568299024406234327365115e+00, - 0.865063366688984510732096688423e+00, - 0.973906528517171720077964012084e+00, - // points 11 - -0.978228658146056992803938001123e+00, - -0.887062599768095299075157769304e+00, - -0.730152005574049324093416252031e+00, - -0.519096129206811815925725669459e+00, - -0.269543155952344972331531985401e+00, - 0.0e+00, - 0.269543155952344972331531985401e+00, - 0.519096129206811815925725669459e+00, - 0.730152005574049324093416252031e+00, - 0.887062599768095299075157769304e+00, - 0.978228658146056992803938001123e+00, - // points 12 - -0.981560634246719250690549090149e+00, - -0.904117256370474856678465866119e+00, - -0.769902674194304687036893833213e+00, - -0.587317954286617447296702418941e+00, - -0.367831498998180193752691536644e+00, - -0.125233408511468915472441369464e+00, - 0.125233408511468915472441369464e+00, - 0.367831498998180193752691536644e+00, - 0.587317954286617447296702418941e+00, - 0.769902674194304687036893833213e+00, - 0.904117256370474856678465866119e+00, - 0.981560634246719250690549090149e+00, - // points 13 - -0.984183054718588149472829448807e+00, - -0.917598399222977965206547836501e+00, - -0.801578090733309912794206489583e+00, - -0.642349339440340220643984606996e+00, - -0.448492751036446852877912852128e+00, - -0.230458315955134794065528121098e+00, - 0.0e+00, - 0.230458315955134794065528121098e+00, - 0.448492751036446852877912852128e+00, - 0.642349339440340220643984606996e+00, - 0.801578090733309912794206489583e+00, - 0.917598399222977965206547836501e+00, - 0.984183054718588149472829448807e+00, - // points 14 - -0.986283808696812338841597266704e+00, - -0.928434883663573517336391139378e+00, - -0.827201315069764993189794742650e+00, - -0.687292904811685470148019803019e+00, - -0.515248636358154091965290718551e+00, - -0.319112368927889760435671824168e+00, - -0.108054948707343662066244650220e+00, - 0.108054948707343662066244650220e+00, - 0.319112368927889760435671824168e+00, - 0.515248636358154091965290718551e+00, - 0.687292904811685470148019803019e+00, - 0.827201315069764993189794742650e+00, - 0.928434883663573517336391139378e+00, - 0.986283808696812338841597266704e+00, - // points 15 - -0.987992518020485428489565718587e+00, - -0.937273392400705904307758947710e+00, - -0.848206583410427216200648320774e+00, - -0.724417731360170047416186054614e+00, - -0.570972172608538847537226737254e+00, - -0.394151347077563369897207370981e+00, - -0.201194093997434522300628303395e+00, - 0.0e+00, - 0.201194093997434522300628303395e+00, - 0.394151347077563369897207370981e+00, - 0.570972172608538847537226737254e+00, - 0.724417731360170047416186054614e+00, - 0.848206583410427216200648320774e+00, - 0.937273392400705904307758947710e+00, - 0.987992518020485428489565718587e+00, - // points 16 - -0.989400934991649932596154173450e+00, - -0.944575023073232576077988415535e+00, - -0.865631202387831743880467897712e+00, - -0.755404408355003033895101194847e+00, - -0.617876244402643748446671764049e+00, - -0.458016777657227386342419442984e+00, - -0.281603550779258913230460501460e+00, - -0.950125098376374401853193354250e-01, - 0.950125098376374401853193354250e-01, - 0.281603550779258913230460501460e+00, - 0.458016777657227386342419442984e+00, - 0.617876244402643748446671764049e+00, - 0.755404408355003033895101194847e+00, - 0.865631202387831743880467897712e+00, - 0.944575023073232576077988415535e+00, - 0.989400934991649932596154173450e+00, - // points 17 - -0.990575475314417335675434019941e+00, - -0.950675521768767761222716957896e+00, - -0.880239153726985902122955694488e+00, - -0.781514003896801406925230055520e+00, - -0.657671159216690765850302216643e+00, - -0.512690537086476967886246568630e+00, - -0.351231763453876315297185517095e+00, - -0.178484181495847855850677493654e+00, - 0.0e+00, - 0.178484181495847855850677493654e+00, - 0.351231763453876315297185517095e+00, - 0.512690537086476967886246568630e+00, - 0.657671159216690765850302216643e+00, - 0.781514003896801406925230055520e+00, - 0.880239153726985902122955694488e+00, - 0.950675521768767761222716957896e+00, - 0.990575475314417335675434019941e+00, - // points 18 - -0.991565168420930946730016004706e+00, - -0.955823949571397755181195892930e+00, - -0.892602466497555739206060591127e+00, - -0.803704958972523115682417455015e+00, - -0.691687043060353207874891081289e+00, - -0.559770831073947534607871548525e+00, - -0.411751161462842646035931793833e+00, - -0.251886225691505509588972854878e+00, - -0.847750130417353012422618529358e-01, - 0.847750130417353012422618529358e-01, - 0.251886225691505509588972854878e+00, - 0.411751161462842646035931793833e+00, - 0.559770831073947534607871548525e+00, - 0.691687043060353207874891081289e+00, - 0.803704958972523115682417455015e+00, - 0.892602466497555739206060591127e+00, - 0.955823949571397755181195892930e+00, - 0.991565168420930946730016004706e+00, - // points 19 - -0.992406843843584403189017670253e+00, - -0.960208152134830030852778840688e+00, - -0.903155903614817901642660928532e+00, - -0.822714656537142824978922486713e+00, - -0.720966177335229378617095860824e+00, - -0.600545304661681023469638164946e+00, - -0.464570741375960945717267148104e+00, - -0.316564099963629831990117328850e+00, - -0.160358645640225375868096115741e+00, - 0.0e+00, - 0.160358645640225375868096115741e+00, - 0.316564099963629831990117328850e+00, - 0.464570741375960945717267148104e+00, - 0.600545304661681023469638164946e+00, - 0.720966177335229378617095860824e+00, - 0.822714656537142824978922486713e+00, - 0.903155903614817901642660928532e+00, - 0.960208152134830030852778840688e+00, - 0.992406843843584403189017670253e+00, - // points 20 - -0.993128599185094924786122388471e+00, - -0.963971927277913791267666131197e+00, - -0.912234428251325905867752441203e+00, - -0.839116971822218823394529061702e+00, - -0.746331906460150792614305070356e+00, - -0.636053680726515025452836696226e+00, - -0.510867001950827098004364050955e+00, - -0.373706088715419560672548177025e+00, - -0.227785851141645078080496195369e+00, - -0.765265211334973337546404093988e-01, - 0.765265211334973337546404093988e-01, - 0.227785851141645078080496195369e+00, - 0.373706088715419560672548177025e+00, - 0.510867001950827098004364050955e+00, - 0.636053680726515025452836696226e+00, - 0.746331906460150792614305070356e+00, - 0.839116971822218823394529061702e+00, - 0.912234428251325905867752441203e+00, - 0.963971927277913791267666131197e+00, - 0.993128599185094924786122388471e+00, - // points 32 - -0.997263861849481563544981128665e+00, - -0.985611511545268335400175044631e+00, - -0.964762255587506430773811928118e+00, - -0.934906075937739689170919134835e+00, - -0.896321155766052123965307243719e+00, - -0.849367613732569970133693004968e+00, - -0.794483795967942406963097298970e+00, - -0.732182118740289680387426665091e+00, - -0.663044266930215200975115168663e+00, - -0.587715757240762329040745476402e+00, - -0.506899908932229390023747474378e+00, - -0.421351276130635345364119436172e+00, - -0.331868602282127649779916805730e+00, - -0.239287362252137074544603209166e+00, - -0.144471961582796493485186373599e+00, - -0.483076656877383162348125704405e-01, - 0.483076656877383162348125704405e-01, - 0.144471961582796493485186373599e+00, - 0.239287362252137074544603209166e+00, - 0.331868602282127649779916805730e+00, - 0.421351276130635345364119436172e+00, - 0.506899908932229390023747474378e+00, - 0.587715757240762329040745476402e+00, - 0.663044266930215200975115168663e+00, - 0.732182118740289680387426665091e+00, - 0.794483795967942406963097298970e+00, - 0.849367613732569970133693004968e+00, - 0.896321155766052123965307243719e+00, - 0.934906075937739689170919134835e+00, - 0.964762255587506430773811928118e+00, - 0.985611511545268335400175044631e+00, - 0.997263861849481563544981128665e+00, - // points 64 - -0.999305041735772139456905624346e+00, - -0.996340116771955279346924500676e+00, - -0.991013371476744320739382383443e+00, - -0.983336253884625956931299302157e+00, - -0.973326827789910963741853507352e+00, - -0.961008799652053718918614121897e+00, - -0.946411374858402816062481491347e+00, - -0.929569172131939575821490154559e+00, - -0.910522137078502805756380668008e+00, - -0.889315445995114105853404038273e+00, - -0.865999398154092819760783385070e+00, - -0.840629296252580362751691544696e+00, - -0.813265315122797559741923338086e+00, - -0.783972358943341407610220525214e+00, - -0.752819907260531896611863774886e+00, - -0.719881850171610826848940217832e+00, - -0.685236313054233242563558371031e+00, - -0.648965471254657339857761231993e+00, - -0.611155355172393250248852971019e+00, - -0.571895646202634034283878116659e+00, - -0.531279464019894545658013903544e+00, - -0.489403145707052957478526307022e+00, - -0.446366017253464087984947714759e+00, - -0.402270157963991603695766771260e+00, - -0.357220158337668115950442615046e+00, - -0.311322871990210956157512698560e+00, - -0.264687162208767416373964172510e+00, - -0.217423643740007084149648748989e+00, - -0.169644420423992818037313629748e+00, - -0.121462819296120554470376463492e+00, - -0.729931217877990394495429419403e-01, - -0.243502926634244325089558428537e-01, - 0.243502926634244325089558428537e-01, - 0.729931217877990394495429419403e-01, - 0.121462819296120554470376463492e+00, - 0.169644420423992818037313629748e+00, - 0.217423643740007084149648748989e+00, - 0.264687162208767416373964172510e+00, - 0.311322871990210956157512698560e+00, - 0.357220158337668115950442615046e+00, - 0.402270157963991603695766771260e+00, - 0.446366017253464087984947714759e+00, - 0.489403145707052957478526307022e+00, - 0.531279464019894545658013903544e+00, - 0.571895646202634034283878116659e+00, - 0.611155355172393250248852971019e+00, - 0.648965471254657339857761231993e+00, - 0.685236313054233242563558371031e+00, - 0.719881850171610826848940217832e+00, - 0.752819907260531896611863774886e+00, - 0.783972358943341407610220525214e+00, - 0.813265315122797559741923338086e+00, - 0.840629296252580362751691544696e+00, - 0.865999398154092819760783385070e+00, - 0.889315445995114105853404038273e+00, - 0.910522137078502805756380668008e+00, - 0.929569172131939575821490154559e+00, - 0.946411374858402816062481491347e+00, - 0.961008799652053718918614121897e+00, - 0.973326827789910963741853507352e+00, - 0.983336253884625956931299302157e+00, - 0.991013371476744320739382383443e+00, - 0.996340116771955279346924500676e+00, - 0.999305041735772139456905624346e+00 -}; +static const double gl_points[] = + { + // points 1 + 0.0e+00, + // points 2 + -0.577350269189625764509148780502e+00, + 0.577350269189625764509148780502e+00, + // points 3 + -0.774596669241483377035853079956e+00, + 0.0e+00, + 0.774596669241483377035853079956e+00, + // points 4 + -0.861136311594052575223946488893e+00, + -0.339981043584856264802665759103e+00, + 0.339981043584856264802665759103e+00, + 0.861136311594052575223946488893e+00, + // points 5 + -0.906179845938663992797626878299e+00, + -0.538469310105683091036314420700e+00, + 0.0e+00, + 0.538469310105683091036314420700e+00, + 0.906179845938663992797626878299e+00, + // points 6 + -0.932469514203152027812301554494e+00, + -0.661209386466264513661399595020e+00, + -0.238619186083196908630501721681e+00, + 0.238619186083196908630501721681e+00, + 0.661209386466264513661399595020e+00, + 0.932469514203152027812301554494e+00, + // points 7 + -0.949107912342758524526189684048e+00, + -0.741531185599394439863864773281e+00, + -0.405845151377397166906606412077e+00, + 0.0e+00, + 0.405845151377397166906606412077e+00, + 0.741531185599394439863864773281e+00, + 0.949107912342758524526189684048e+00, + // points 8 + -0.960289856497536231683560868569e+00, + -0.796666477413626739591553936476e+00, + -0.525532409916328985817739049189e+00, + -0.183434642495649804939476142360e+00, + 0.183434642495649804939476142360e+00, + 0.525532409916328985817739049189e+00, + 0.796666477413626739591553936476e+00, + 0.960289856497536231683560868569e+00, + // points 9 + -0.968160239507626089835576202904e+00, + -0.836031107326635794299429788070e+00, + -0.613371432700590397308702039341e+00, + -0.324253423403808929038538014643e+00, + 0.0e+00, + 0.324253423403808929038538014643e+00, + 0.613371432700590397308702039341e+00, + 0.836031107326635794299429788070e+00, + 0.968160239507626089835576202904e+00, + // points 10 + -0.973906528517171720077964012084e+00, + -0.865063366688984510732096688423e+00, + -0.679409568299024406234327365115e+00, + -0.433395394129247190799265943166e+00, + -0.148874338981631210884826001130e+00, + 0.148874338981631210884826001130e+00, + 0.433395394129247190799265943166e+00, + 0.679409568299024406234327365115e+00, + 0.865063366688984510732096688423e+00, + 0.973906528517171720077964012084e+00, + // points 11 + -0.978228658146056992803938001123e+00, + -0.887062599768095299075157769304e+00, + -0.730152005574049324093416252031e+00, + -0.519096129206811815925725669459e+00, + -0.269543155952344972331531985401e+00, + 0.0e+00, + 0.269543155952344972331531985401e+00, + 0.519096129206811815925725669459e+00, + 0.730152005574049324093416252031e+00, + 0.887062599768095299075157769304e+00, + 0.978228658146056992803938001123e+00, + // points 12 + -0.981560634246719250690549090149e+00, + -0.904117256370474856678465866119e+00, + -0.769902674194304687036893833213e+00, + -0.587317954286617447296702418941e+00, + -0.367831498998180193752691536644e+00, + -0.125233408511468915472441369464e+00, + 0.125233408511468915472441369464e+00, + 0.367831498998180193752691536644e+00, + 0.587317954286617447296702418941e+00, + 0.769902674194304687036893833213e+00, + 0.904117256370474856678465866119e+00, + 0.981560634246719250690549090149e+00, + // points 13 + -0.984183054718588149472829448807e+00, + -0.917598399222977965206547836501e+00, + -0.801578090733309912794206489583e+00, + -0.642349339440340220643984606996e+00, + -0.448492751036446852877912852128e+00, + -0.230458315955134794065528121098e+00, + 0.0e+00, + 0.230458315955134794065528121098e+00, + 0.448492751036446852877912852128e+00, + 0.642349339440340220643984606996e+00, + 0.801578090733309912794206489583e+00, + 0.917598399222977965206547836501e+00, + 0.984183054718588149472829448807e+00, + // points 14 + -0.986283808696812338841597266704e+00, + -0.928434883663573517336391139378e+00, + -0.827201315069764993189794742650e+00, + -0.687292904811685470148019803019e+00, + -0.515248636358154091965290718551e+00, + -0.319112368927889760435671824168e+00, + -0.108054948707343662066244650220e+00, + 0.108054948707343662066244650220e+00, + 0.319112368927889760435671824168e+00, + 0.515248636358154091965290718551e+00, + 0.687292904811685470148019803019e+00, + 0.827201315069764993189794742650e+00, + 0.928434883663573517336391139378e+00, + 0.986283808696812338841597266704e+00, + // points 15 + -0.987992518020485428489565718587e+00, + -0.937273392400705904307758947710e+00, + -0.848206583410427216200648320774e+00, + -0.724417731360170047416186054614e+00, + -0.570972172608538847537226737254e+00, + -0.394151347077563369897207370981e+00, + -0.201194093997434522300628303395e+00, + 0.0e+00, + 0.201194093997434522300628303395e+00, + 0.394151347077563369897207370981e+00, + 0.570972172608538847537226737254e+00, + 0.724417731360170047416186054614e+00, + 0.848206583410427216200648320774e+00, + 0.937273392400705904307758947710e+00, + 0.987992518020485428489565718587e+00, + // points 16 + -0.989400934991649932596154173450e+00, + -0.944575023073232576077988415535e+00, + -0.865631202387831743880467897712e+00, + -0.755404408355003033895101194847e+00, + -0.617876244402643748446671764049e+00, + -0.458016777657227386342419442984e+00, + -0.281603550779258913230460501460e+00, + -0.950125098376374401853193354250e-01, + 0.950125098376374401853193354250e-01, + 0.281603550779258913230460501460e+00, + 0.458016777657227386342419442984e+00, + 0.617876244402643748446671764049e+00, + 0.755404408355003033895101194847e+00, + 0.865631202387831743880467897712e+00, + 0.944575023073232576077988415535e+00, + 0.989400934991649932596154173450e+00, + // points 17 + -0.990575475314417335675434019941e+00, + -0.950675521768767761222716957896e+00, + -0.880239153726985902122955694488e+00, + -0.781514003896801406925230055520e+00, + -0.657671159216690765850302216643e+00, + -0.512690537086476967886246568630e+00, + -0.351231763453876315297185517095e+00, + -0.178484181495847855850677493654e+00, + 0.0e+00, + 0.178484181495847855850677493654e+00, + 0.351231763453876315297185517095e+00, + 0.512690537086476967886246568630e+00, + 0.657671159216690765850302216643e+00, + 0.781514003896801406925230055520e+00, + 0.880239153726985902122955694488e+00, + 0.950675521768767761222716957896e+00, + 0.990575475314417335675434019941e+00, + // points 18 + -0.991565168420930946730016004706e+00, + -0.955823949571397755181195892930e+00, + -0.892602466497555739206060591127e+00, + -0.803704958972523115682417455015e+00, + -0.691687043060353207874891081289e+00, + -0.559770831073947534607871548525e+00, + -0.411751161462842646035931793833e+00, + -0.251886225691505509588972854878e+00, + -0.847750130417353012422618529358e-01, + 0.847750130417353012422618529358e-01, + 0.251886225691505509588972854878e+00, + 0.411751161462842646035931793833e+00, + 0.559770831073947534607871548525e+00, + 0.691687043060353207874891081289e+00, + 0.803704958972523115682417455015e+00, + 0.892602466497555739206060591127e+00, + 0.955823949571397755181195892930e+00, + 0.991565168420930946730016004706e+00, + // points 19 + -0.992406843843584403189017670253e+00, + -0.960208152134830030852778840688e+00, + -0.903155903614817901642660928532e+00, + -0.822714656537142824978922486713e+00, + -0.720966177335229378617095860824e+00, + -0.600545304661681023469638164946e+00, + -0.464570741375960945717267148104e+00, + -0.316564099963629831990117328850e+00, + -0.160358645640225375868096115741e+00, + 0.0e+00, + 0.160358645640225375868096115741e+00, + 0.316564099963629831990117328850e+00, + 0.464570741375960945717267148104e+00, + 0.600545304661681023469638164946e+00, + 0.720966177335229378617095860824e+00, + 0.822714656537142824978922486713e+00, + 0.903155903614817901642660928532e+00, + 0.960208152134830030852778840688e+00, + 0.992406843843584403189017670253e+00, + // points 20 + -0.993128599185094924786122388471e+00, + -0.963971927277913791267666131197e+00, + -0.912234428251325905867752441203e+00, + -0.839116971822218823394529061702e+00, + -0.746331906460150792614305070356e+00, + -0.636053680726515025452836696226e+00, + -0.510867001950827098004364050955e+00, + -0.373706088715419560672548177025e+00, + -0.227785851141645078080496195369e+00, + -0.765265211334973337546404093988e-01, + 0.765265211334973337546404093988e-01, + 0.227785851141645078080496195369e+00, + 0.373706088715419560672548177025e+00, + 0.510867001950827098004364050955e+00, + 0.636053680726515025452836696226e+00, + 0.746331906460150792614305070356e+00, + 0.839116971822218823394529061702e+00, + 0.912234428251325905867752441203e+00, + 0.963971927277913791267666131197e+00, + 0.993128599185094924786122388471e+00, + // points 32 + -0.997263861849481563544981128665e+00, + -0.985611511545268335400175044631e+00, + -0.964762255587506430773811928118e+00, + -0.934906075937739689170919134835e+00, + -0.896321155766052123965307243719e+00, + -0.849367613732569970133693004968e+00, + -0.794483795967942406963097298970e+00, + -0.732182118740289680387426665091e+00, + -0.663044266930215200975115168663e+00, + -0.587715757240762329040745476402e+00, + -0.506899908932229390023747474378e+00, + -0.421351276130635345364119436172e+00, + -0.331868602282127649779916805730e+00, + -0.239287362252137074544603209166e+00, + -0.144471961582796493485186373599e+00, + -0.483076656877383162348125704405e-01, + 0.483076656877383162348125704405e-01, + 0.144471961582796493485186373599e+00, + 0.239287362252137074544603209166e+00, + 0.331868602282127649779916805730e+00, + 0.421351276130635345364119436172e+00, + 0.506899908932229390023747474378e+00, + 0.587715757240762329040745476402e+00, + 0.663044266930215200975115168663e+00, + 0.732182118740289680387426665091e+00, + 0.794483795967942406963097298970e+00, + 0.849367613732569970133693004968e+00, + 0.896321155766052123965307243719e+00, + 0.934906075937739689170919134835e+00, + 0.964762255587506430773811928118e+00, + 0.985611511545268335400175044631e+00, + 0.997263861849481563544981128665e+00, + // points 64 + -0.999305041735772139456905624346e+00, + -0.996340116771955279346924500676e+00, + -0.991013371476744320739382383443e+00, + -0.983336253884625956931299302157e+00, + -0.973326827789910963741853507352e+00, + -0.961008799652053718918614121897e+00, + -0.946411374858402816062481491347e+00, + -0.929569172131939575821490154559e+00, + -0.910522137078502805756380668008e+00, + -0.889315445995114105853404038273e+00, + -0.865999398154092819760783385070e+00, + -0.840629296252580362751691544696e+00, + -0.813265315122797559741923338086e+00, + -0.783972358943341407610220525214e+00, + -0.752819907260531896611863774886e+00, + -0.719881850171610826848940217832e+00, + -0.685236313054233242563558371031e+00, + -0.648965471254657339857761231993e+00, + -0.611155355172393250248852971019e+00, + -0.571895646202634034283878116659e+00, + -0.531279464019894545658013903544e+00, + -0.489403145707052957478526307022e+00, + -0.446366017253464087984947714759e+00, + -0.402270157963991603695766771260e+00, + -0.357220158337668115950442615046e+00, + -0.311322871990210956157512698560e+00, + -0.264687162208767416373964172510e+00, + -0.217423643740007084149648748989e+00, + -0.169644420423992818037313629748e+00, + -0.121462819296120554470376463492e+00, + -0.729931217877990394495429419403e-01, + -0.243502926634244325089558428537e-01, + 0.243502926634244325089558428537e-01, + 0.729931217877990394495429419403e-01, + 0.121462819296120554470376463492e+00, + 0.169644420423992818037313629748e+00, + 0.217423643740007084149648748989e+00, + 0.264687162208767416373964172510e+00, + 0.311322871990210956157512698560e+00, + 0.357220158337668115950442615046e+00, + 0.402270157963991603695766771260e+00, + 0.446366017253464087984947714759e+00, + 0.489403145707052957478526307022e+00, + 0.531279464019894545658013903544e+00, + 0.571895646202634034283878116659e+00, + 0.611155355172393250248852971019e+00, + 0.648965471254657339857761231993e+00, + 0.685236313054233242563558371031e+00, + 0.719881850171610826848940217832e+00, + 0.752819907260531896611863774886e+00, + 0.783972358943341407610220525214e+00, + 0.813265315122797559741923338086e+00, + 0.840629296252580362751691544696e+00, + 0.865999398154092819760783385070e+00, + 0.889315445995114105853404038273e+00, + 0.910522137078502805756380668008e+00, + 0.929569172131939575821490154559e+00, + 0.946411374858402816062481491347e+00, + 0.961008799652053718918614121897e+00, + 0.973326827789910963741853507352e+00, + 0.983336253884625956931299302157e+00, + 0.991013371476744320739382383443e+00, + 0.996340116771955279346924500676e+00, + 0.999305041735772139456905624346e+00 + }; diff --git a/dynare++/integ/cc/quadrature.hh b/dynare++/integ/cc/quadrature.hh index 7c6cb8e2c4221b028ae4c5f67f181e8bb04a2be7..501713cfc49447b57de4cea1b3d51c8b13c0e032 100644 --- a/dynare++/integ/cc/quadrature.hh +++ b/dynare++/integ/cc/quadrature.hh @@ -109,10 +109,10 @@ public: See QuadratureImpl class declaration for details. */ -template <typename _Tpit> +template<typename _Tpit> class QuadratureImpl; -template <typename _Tpit> +template<typename _Tpit> class IntegrationWorker : public sthread::detach_thread { const QuadratureImpl<_Tpit> &quad; @@ -168,7 +168,7 @@ public: In addition, we define a method which saves all the points to a given file. Only for debugging purposes. */ -template <typename _Tpit> +template<typename _Tpit> class QuadratureImpl : public Quadrature { friend class IntegrationWorker<_Tpit>; @@ -257,7 +257,7 @@ class OneDPrecalcQuadrature : public OneDQuadrature public: OneDPrecalcQuadrature(int nlevels, const int *npoints, const double *wts, const double *pts) - : num_levels(nlevels), num_points(npoints), + : num_levels(nlevels), num_points(npoints), weights(wts), points(pts), offsets(num_levels) { calcOffsets(); diff --git a/dynare++/integ/cc/quasi_mcarlo.cc b/dynare++/integ/cc/quasi_mcarlo.cc index fef6bfdf1199df695addcee4af6eda66f9060a39..80c5740f63fdfea0af004eb4a6f82e215bdfa747 100644 --- a/dynare++/integ/cc/quasi_mcarlo.cc +++ b/dynare++/integ/cc/quasi_mcarlo.cc @@ -106,25 +106,26 @@ RadicalInverse::print() const /* Here we have the first 170 primes. This means that we are not able to integrate dimensions greater than 170. */ -std::array<int, 170> HaltonSequence::primes = { - 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, - 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, - 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, - 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, - 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, - 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, - 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, - 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, - 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, - 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, - 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, - 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, - 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, - 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, - 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, - 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, - 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013 -}; +std::array<int, 170> HaltonSequence::primes = + { + 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, + 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, + 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, + 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, + 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, + 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, + 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, + 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, + 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, + 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, + 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, + 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, + 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, + 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, + 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, + 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, + 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013 + }; /* This takes first ‘dim’ primes and constructs ‘dim’ radical inverses and calls eval(). */ @@ -145,7 +146,7 @@ HaltonSequence::HaltonSequence(int n, int mxn, int dim, const PermutationScheme void HaltonSequence::increase() { - for (auto & i : ri) + for (auto &i : ri) i.increase(); num++; if (num <= maxn) @@ -165,7 +166,7 @@ void HaltonSequence::print() const { auto ff = std::cout.flags(); - for (const auto & i : ri) + for (const auto &i : ri) i.print(); std::cout << "point=[ " << std::fixed << std::setprecision(6); diff --git a/dynare++/integ/cc/vector_function.cc b/dynare++/integ/cc/vector_function.cc index bca1b1afabc8f1213b94a354272df434b293eb58..c541ba0f245cfed7b0a7d5c7f9332c8d81ce4191 100644 --- a/dynare++/integ/cc/vector_function.cc +++ b/dynare++/integ/cc/vector_function.cc @@ -70,7 +70,6 @@ VectorFunctionSet::VectorFunctionSet(VectorFunction &f, int n) } } - /* Here we construct the object from the given function f and given variance-covariance matrix Σ=vcov. The matrix A is calculated as lower triangular and yields Σ=AAᵀ. */ diff --git a/dynare++/integ/src/quadrature-points.cc b/dynare++/integ/src/quadrature-points.cc index 0e62fef04b6a77c25641155cd712d227915246c5..2973a222f4aee61af31b93b8f92665ca4b9156f8 100644 --- a/dynare++/integ/src/quadrature-points.cc +++ b/dynare++/integ/src/quadrature-points.cc @@ -47,7 +47,7 @@ struct QuadParams QuadParams(int argc, char **argv); void check_consistency() const; private: - enum class opt {max_level, discard_weight, vcov}; + enum class opt { max_level, discard_weight, vcov }; }; QuadParams::QuadParams(int argc, char **argv) @@ -62,11 +62,11 @@ QuadParams::QuadParams(int argc, char **argv) outname = argv[argc-1]; argc--; - struct option const opts [] = { - {"max-level", required_argument, nullptr, static_cast<int>(opt::max_level)}, - {"discard-weight", required_argument, nullptr, static_cast<int>(opt::discard_weight)}, - {"vcov", required_argument, nullptr, static_cast<int>(opt::vcov)}, - {nullptr, 0, nullptr, 0} + struct option const opts[] = { + {"max-level", required_argument, nullptr, static_cast<int>(opt::max_level)}, + {"discard-weight", required_argument, nullptr, static_cast<int>(opt::discard_weight)}, + {"vcov", required_argument, nullptr, static_cast<int>(opt::vcov)}, + {nullptr, 0, nullptr, 0} }; int ret; @@ -188,7 +188,7 @@ main(int argc, char **argv) // Calculate weights and mass double mass = 0.0; std::vector<double> weights; - for (auto & point : points) + for (auto &point : points) { weights.push_back(std::exp(-point->dot(*point))); mass += weights.back(); diff --git a/dynare++/integ/testing/tests.cc b/dynare++/integ/testing/tests.cc index 030fe5b1a7ad6a4ade4c706a2b7500ef9d555a58..9143ddac10d4c8f095512ddc7477f80d89b55e32 100644 --- a/dynare++/integ/testing/tests.cc +++ b/dynare++/integ/testing/tests.cc @@ -177,7 +177,7 @@ Function1Trans::eval(const Vector &point, const ParameterSignal &sig, Vector &ou } /* WallTimer class. Constructor saves the wall time, destructor cancels the - current time from the saved, and prints the message with time information */ + current time from the saved, and prints the message with time information */ class WallTimer { std::string mes; diff --git a/dynare++/kord/approximation.cc b/dynare++/kord/approximation.cc index 2c97471dafa796fd3b72c6e154bff44436f973b9..045753d2dafa176a411fd0fc1ee20b811df54b91 100644 --- a/dynare++/kord/approximation.cc +++ b/dynare++/kord/approximation.cc @@ -51,7 +51,7 @@ Approximation::Approximation(DynamicModel &m, Journal &j, int ns, bool dr_centr, : model(m), journal(j), ypart(model.nstat(), model.npred(), model.nboth(), model.nforw()), mom(UNormalMoments(model.order(), model.getVcov())), - nvs{ypart.nys(), model.nexog(), model.nexog(), 1 }, + nvs{ypart.nys(), model.nexog(), model.nexog(), 1}, steps(ns), dr_centralize(dr_centr), qz_criterium(qz_crit), ss(ypart.ny(), steps+1) { @@ -184,7 +184,7 @@ Approximation::walkStochSteady() dy.add(-1.0, last_steady); StochForwardDerivs<Storage::fold> hh(ypart, model.nexog(), *rule_ders_ss, mom, dy, - dsigma, sigma_so_far); + dsigma, sigma_so_far); JournalRecord rec1(journal); rec1 << "Calculation of g** expectations done" << endrec; diff --git a/dynare++/kord/decision_rule.cc b/dynare++/kord/decision_rule.cc index f9e86a685367c7dbb241907483027b7e30f6a020..5d0a624f47e898e1e0b0c7d2053d47cf53d4e396 100644 --- a/dynare++/kord/decision_rule.cc +++ b/dynare++/kord/decision_rule.cc @@ -34,7 +34,7 @@ // FoldDecisionRule conversion from UnfoldDecisionRule FoldDecisionRule::FoldDecisionRule(const UnfoldDecisionRule &udr) : DecisionRuleImpl<Storage::fold>(ctraits<Storage::fold>::Tpol(udr.nrows(), udr.nvars()), - udr.ypart, udr.nu, udr.ysteady) + udr.ypart, udr.nu, udr.ysteady) { for (const auto &it : udr) insert(std::make_unique<ctraits<Storage::fold>::Ttensym>(*(it.second))); @@ -43,7 +43,7 @@ FoldDecisionRule::FoldDecisionRule(const UnfoldDecisionRule &udr) // UnfoldDecisionRule conversion from FoldDecisionRule UnfoldDecisionRule::UnfoldDecisionRule(const FoldDecisionRule &fdr) : DecisionRuleImpl<Storage::unfold>(ctraits<Storage::unfold>::Tpol(fdr.nrows(), fdr.nvars()), - fdr.ypart, fdr.nu, fdr.ysteady) + fdr.ypart, fdr.nu, fdr.ysteady) { for (const auto &it : fdr) insert(std::make_unique<ctraits<Storage::unfold>::Ttensym>(*(it.second))); diff --git a/dynare++/kord/decision_rule.hh b/dynare++/kord/decision_rule.hh index 3956d5128cc8e29030375db6e50aef63f8c0c43d..6bf3e9834d92beaa7ab53ed503fe139407f36465 100644 --- a/dynare++/kord/decision_rule.hh +++ b/dynare++/kord/decision_rule.hh @@ -75,7 +75,7 @@ public: virtual void eval(emethod em, Vector &out, const ConstVector &v) const = 0; /* makes only one step of simulation (in terms of absolute values, not - deviations) */ + deviations) */ virtual void evaluate(emethod em, Vector &out, const ConstVector &ys, const ConstVector &u) const = 0; @@ -120,7 +120,7 @@ public: Storage::unfold. So, there are two implementations of the DecisionRule interface. */ -template <Storage t> +template<Storage t> class DecisionRuleImpl : public ctraits<t>::Tpol, public DecisionRule { protected: @@ -220,7 +220,7 @@ public: So we go through i+j=d=0…q and in each loop we form the fully symmetric tensor [g_(yu)ᵈ] and insert it to the container. */ -template <Storage t> +template<Storage t> void DecisionRuleImpl<t>::fillTensors(const _Tg &g, double sigma) { @@ -277,7 +277,7 @@ DecisionRuleImpl<t>::fillTensors(const _Tg &g, double sigma) where ȳ is the steady state of the original rule ‘dr’. */ -template <Storage t> +template<Storage t> void DecisionRuleImpl<t>::centralize(const DecisionRuleImpl &dr) { @@ -310,7 +310,7 @@ DecisionRuleImpl<t>::centralize(const DecisionRuleImpl &dr) canceled from ‘ystart’, we simulate, and at the end ‘ysteady’ is added to all columns of the result. */ -template <Storage t> +template<Storage t> TwoDMatrix DecisionRuleImpl<t>::simulate(emethod em, int np, const ConstVector &ystart, ShockRealization &sr) const @@ -378,7 +378,7 @@ DecisionRuleImpl<t>::simulate(emethod em, int np, const ConstVector &ystart, steady state (fix point) is cancelled and added once. Hence we have two special methods. */ -template <Storage t> +template<Storage t> void DecisionRuleImpl<t>::evaluate(emethod em, Vector &out, const ConstVector &ys, const ConstVector &u) const @@ -401,7 +401,7 @@ DecisionRuleImpl<t>::evaluate(emethod em, Vector &out, const ConstVector &ys, /* This is easy. We just return the newly created copy using the centralized constructor. */ -template <Storage t> +template<Storage t> std::unique_ptr<DecisionRule> DecisionRuleImpl<t>::centralizedClone(const Vector &fixpoint) const { @@ -411,7 +411,7 @@ DecisionRuleImpl<t>::centralizedClone(const Vector &fixpoint) const /* Here we only encapsulate two implementations to one, deciding according to the parameter. */ -template <Storage t> +template<Storage t> void DecisionRuleImpl<t>::eval(emethod em, Vector &out, const ConstVector &v) const { @@ -423,7 +423,7 @@ DecisionRuleImpl<t>::eval(emethod em, Vector &out, const ConstVector &v) const /* Write the decision rule and steady state to the MAT file. */ -template <Storage t> +template<Storage t> void DecisionRuleImpl<t>::writeMat(mat_t *fd, const std::string &prefix) const { @@ -506,7 +506,7 @@ public: F is given by its derivatives ‘bigf’. The Jacobian of the solved system is given by derivatives stored in ‘bigfder’. */ -template <Storage t> +template<Storage t> class DRFixPoint : public ctraits<t>::Tpol { using _Tpol = typename ctraits<t>::Tpol; @@ -557,7 +557,7 @@ private: first derivative (Symmetry{1}). Then the derivative of the F polynomial is calculated. */ -template <Storage t> +template<Storage t> DRFixPoint<t>::DRFixPoint(const _Tg &g, const PartitionY &yp, const Vector &ys, double sigma) : ctraits<t>::Tpol(yp.ny(), yp.nys()), @@ -577,7 +577,7 @@ DRFixPoint<t>::DRFixPoint(const _Tg &g, const PartitionY &yp, such that ‘d+k’ is between the maximum dimension and ‘d’, and add σᵏ/(d!k!)[g_yᵈσᵏ] to the tensor [g_yᵈ]. */ -template <Storage t> +template<Storage t> void DRFixPoint<t>::fillTensors(const _Tg &g, double sigma) { @@ -612,7 +612,7 @@ DRFixPoint<t>::fillTensors(const _Tg &g, double sigma) underrelaxation parameter ‘urelax’, which improves the residual. If ‘urelax’ is less that ‘urelax_threshold’, we stop searching and stop the Newton. */ -template <Storage t> +template<Storage t> bool DRFixPoint<t>::solveNewton(Vector &y) { @@ -666,7 +666,7 @@ DRFixPoint<t>::solveNewton(Vector &y) flastnorm = fnorm; } while (!converged && newton_iter_last < max_newton_iter - &&urelax > urelax_threshold); + && urelax > urelax_threshold); newton_iter_total += newton_iter_last; if (!converged) @@ -688,7 +688,7 @@ DRFixPoint<t>::solveNewton(Vector &y) The ‘out’ vector is not touched if the algorithm has not convered. */ -template <Storage t> +template<Storage t> bool DRFixPoint<t>::calcFixPoint(emethod em, Vector &out) { diff --git a/dynare++/kord/dynamic_model.hh b/dynare++/kord/dynamic_model.hh index ef9464339bb48847de5533454ac9bbd8ab2eaf58..cd129ccddf6b536c8238a1dc2cc9bad37adab5da 100644 --- a/dynare++/kord/dynamic_model.hh +++ b/dynare++/kord/dynamic_model.hh @@ -18,7 +18,6 @@ * along with Dynare. If not, see <http://www.gnu.org/licenses/>. */ - // Dynamic model abstraction /* This file only defines a generic interface to a DSGE model. The model diff --git a/dynare++/kord/faa_di_bruno.hh b/dynare++/kord/faa_di_bruno.hh index 4442ba7c5b34698c6406d7c7655b16075151e38f..8ccbaf4bcf2da735f0f1bc4911624a968f8ff81f 100644 --- a/dynare++/kord/faa_di_bruno.hh +++ b/dynare++/kord/faa_di_bruno.hh @@ -57,7 +57,7 @@ public: void calculate(const UnfoldedStackContainer &cont, const UGSContainer &g, UGSTensor &out); protected: - std::tuple<int,int,int> estimRefinement(const TensorDimens &tdims, int nr, int l); + std::tuple<int, int, int> estimRefinement(const TensorDimens &tdims, int nr, int l); // See FaaDiBruno::calculate() folded sparse code for why we have magic_mult constexpr static double magic_mult = 1.5; diff --git a/dynare++/kord/first_order.cc b/dynare++/kord/first_order.cc index 6d473d765ee555b253ab86b949ee1e75f8a0265e..96508183cf9697a25519bb94f6b9f503cc24ea11 100644 --- a/dynare++/kord/first_order.cc +++ b/dynare++/kord/first_order.cc @@ -178,9 +178,9 @@ FirstOrder::solve(const TwoDMatrix &fd) std::lock_guard<std::mutex> lk{mut}; qz_criterium_global = qz_criterium; dgges("N", "V", "S", order_eigs, &n, matE.getData().base(), &lda, - matD.getData().base(), &ldb, &sdim2, alphar.base(), alphai.base(), - beta.base(), vsl.getData().base(), &ldvsl, vsr.getData().base(), &ldvsr, - work.base(), &lwork, bwork.get(), &info); + matD.getData().base(), &ldb, &sdim2, alphar.base(), alphai.base(), + beta.base(), vsl.getData().base(), &ldvsl, vsr.getData().base(), &ldvsr, + work.base(), &lwork, bwork.get(), &info); } if (info) throw KordException(__FILE__, __LINE__, diff --git a/dynare++/kord/first_order.hh b/dynare++/kord/first_order.hh index 044f7a4b164c5fb365c487431d2a302821b282e6..6d3c35b01de87a07cea5c04bfcb3e6909a10db7c 100644 --- a/dynare++/kord/first_order.hh +++ b/dynare++/kord/first_order.hh @@ -31,7 +31,7 @@ template<Storage> class FirstOrderDerivs; class FirstOrder { - template <Storage> + template<Storage> friend class FirstOrderDerivs; PartitionY ypart; int nu; @@ -89,7 +89,7 @@ protected: /* This class only converts the derivatives g_y* and gᵤ to a folded or unfolded container. */ -template <Storage t> +template<Storage t> class FirstOrderDerivs : public ctraits<t>::Tg { public: diff --git a/dynare++/kord/global_check.hh b/dynare++/kord/global_check.hh index df7f913a8afc0bf49ae0e941da89965dec044b27..8e7b35714c21efd32800db94e7432636a3d39ab2 100644 --- a/dynare++/kord/global_check.hh +++ b/dynare++/kord/global_check.hh @@ -90,7 +90,7 @@ protected: public: ResidFunction(const Approximation &app); ResidFunction(const ResidFunction &rf); - + std::unique_ptr<VectorFunction> clone() const override { diff --git a/dynare++/kord/journal.cc b/dynare++/kord/journal.cc index e06d35bebcb75ac6d5d668ec89551cc7ebd870a1..b8eaabd473f5c3ad975b7af55391553e0996e029 100644 --- a/dynare++/kord/journal.cc +++ b/dynare++/kord/journal.cc @@ -145,7 +145,7 @@ JournalRecord::writePrefix(const SystemResources &f) std::ostringstream s; s << std::setfill('0'); writeFloatTabular(s, f.elapsed, 7); - s << u8"│" << recChar << std::setw(5) << ord << u8"│"; + s << u8"│" << recChar << std::setw(5) << ord << u8"│"; writeFloatTabular(s, f.load_avg, 3); s << u8"│"; writeFloatTabular(s, f.mem_avail/mb, 5); diff --git a/dynare++/kord/kord_exception.hh b/dynare++/kord/kord_exception.hh index bd7febba81b9d5560d57a5918fceda824beff984..f5777241e919f2b99db899a001f83495e49bd0a1 100644 --- a/dynare++/kord/kord_exception.hh +++ b/dynare++/kord/kord_exception.hh @@ -26,18 +26,18 @@ #include <iostream> #ifndef KORD_EXCEPTION_H -#define KORD_EXCEPTION_H +# define KORD_EXCEPTION_H -#define KORD_RAISE(mes) \ +# define KORD_RAISE(mes) \ throw KordException(__FILE__, __LINE__, mes); -#define KORD_RAISE_IF(expr, mes) \ +# define KORD_RAISE_IF(expr, mes) \ if (expr) throw KordException(__FILE__, __LINE__, mes); -#define KORD_RAISE_X(mes, c) \ +# define KORD_RAISE_X(mes, c) \ throw KordException(__FILE__, __LINE__, mes, c); -#define KORD_RAISE_IF_X(expr, mes, c) \ +# define KORD_RAISE_IF_X(expr, mes, c) \ if (expr) throw KordException(__FILE__, __LINE__, mes, c); class KordException diff --git a/dynare++/kord/korder.cc b/dynare++/kord/korder.cc index 0c0c265b026214a3da74beb9e986b1395540d8ed..3ba9425b597fe71b8018dbe7b3c34cadb16b4ebf 100644 --- a/dynare++/kord/korder.cc +++ b/dynare++/kord/korder.cc @@ -112,117 +112,173 @@ MatrixS::MatrixS(const FSSparseTensor &f, const IntSequence &ss, interesting here. */ template<> -ctraits<Storage::unfold>::Tg& KOrder::g<Storage::unfold>() +ctraits<Storage::unfold>::Tg & +KOrder::g<Storage::unfold>() { return _ug; } template<> -const ctraits<Storage::unfold>::Tg& KOrder::g<Storage::unfold>() const -{ return _ug;} +const ctraits<Storage::unfold>::Tg & +KOrder::g<Storage::unfold>() const +{ + return _ug; +} template<> -ctraits<Storage::fold>::Tg& KOrder::g<Storage::fold>() +ctraits<Storage::fold>::Tg & +KOrder::g<Storage::fold>() { return _fg; } template<> -const ctraits<Storage::fold>::Tg& KOrder::g<Storage::fold>() const -{ return _fg;} +const ctraits<Storage::fold>::Tg & +KOrder::g<Storage::fold>() const +{ + return _fg; +} template<> -ctraits<Storage::unfold>::Tgs& KOrder::gs<Storage::unfold>() +ctraits<Storage::unfold>::Tgs & +KOrder::gs<Storage::unfold>() { return _ugs; } template<> -const ctraits<Storage::unfold>::Tgs& KOrder::gs<Storage::unfold>() const -{ return _ugs;} +const ctraits<Storage::unfold>::Tgs & +KOrder::gs<Storage::unfold>() const +{ + return _ugs; +} template<> -ctraits<Storage::fold>::Tgs& KOrder::gs<Storage::fold>() +ctraits<Storage::fold>::Tgs & +KOrder::gs<Storage::fold>() { return _fgs; } template<> -const ctraits<Storage::fold>::Tgs& KOrder::gs<Storage::fold>() const -{ return _fgs;} +const ctraits<Storage::fold>::Tgs & +KOrder::gs<Storage::fold>() const +{ + return _fgs; +} template<> -ctraits<Storage::unfold>::Tgss& KOrder::gss<Storage::unfold>() +ctraits<Storage::unfold>::Tgss & +KOrder::gss<Storage::unfold>() { return _ugss; } template<> -const ctraits<Storage::unfold>::Tgss& KOrder::gss<Storage::unfold>() const -{ return _ugss;} +const ctraits<Storage::unfold>::Tgss & +KOrder::gss<Storage::unfold>() const +{ + return _ugss; +} template<> -ctraits<Storage::fold>::Tgss& KOrder::gss<Storage::fold>() +ctraits<Storage::fold>::Tgss & +KOrder::gss<Storage::fold>() { return _fgss; } template<> -const ctraits<Storage::fold>::Tgss& KOrder::gss<Storage::fold>() const -{ return _fgss;} +const ctraits<Storage::fold>::Tgss & +KOrder::gss<Storage::fold>() const +{ + return _fgss; +} template<> -ctraits<Storage::unfold>::TG& KOrder::G<Storage::unfold>() +ctraits<Storage::unfold>::TG & +KOrder::G<Storage::unfold>() { return _uG; } template<> -const ctraits<Storage::unfold>::TG& KOrder::G<Storage::unfold>() const -{ return _uG;} +const ctraits<Storage::unfold>::TG & +KOrder::G<Storage::unfold>() const +{ + return _uG; +} template<> -ctraits<Storage::fold>::TG& KOrder::G<Storage::fold>() +ctraits<Storage::fold>::TG & +KOrder::G<Storage::fold>() { return _fG; } template<> -const ctraits<Storage::fold>::TG& KOrder::G<Storage::fold>() const -{ return _fG;} +const ctraits<Storage::fold>::TG & +KOrder::G<Storage::fold>() const +{ + return _fG; +} template<> -ctraits<Storage::unfold>::TZstack& KOrder::Zstack<Storage::unfold>() +ctraits<Storage::unfold>::TZstack & +KOrder::Zstack<Storage::unfold>() { return _uZstack; } template<> -const ctraits<Storage::unfold>::TZstack& KOrder::Zstack<Storage::unfold>() const -{ return _uZstack;} +const ctraits<Storage::unfold>::TZstack & +KOrder::Zstack<Storage::unfold>() const +{ + return _uZstack; +} template<> -ctraits<Storage::fold>::TZstack& KOrder::Zstack<Storage::fold>() +ctraits<Storage::fold>::TZstack & +KOrder::Zstack<Storage::fold>() { return _fZstack; } template<> -const ctraits<Storage::fold>::TZstack& KOrder::Zstack<Storage::fold>() const -{ return _fZstack;} +const ctraits<Storage::fold>::TZstack & +KOrder::Zstack<Storage::fold>() const +{ + return _fZstack; +} template<> -ctraits<Storage::unfold>::TGstack& KOrder::Gstack<Storage::unfold>() +ctraits<Storage::unfold>::TGstack & +KOrder::Gstack<Storage::unfold>() { return _uGstack; } template<> -const ctraits<Storage::unfold>::TGstack& KOrder::Gstack<Storage::unfold>() const -{ return _uGstack;} +const ctraits<Storage::unfold>::TGstack & +KOrder::Gstack<Storage::unfold>() const +{ + return _uGstack; +} template<> -ctraits<Storage::fold>::TGstack& KOrder::Gstack<Storage::fold>() +ctraits<Storage::fold>::TGstack & +KOrder::Gstack<Storage::fold>() { return _fGstack; } template<> -const ctraits<Storage::fold>::TGstack& KOrder::Gstack<Storage::fold>() const -{ return _fGstack;} +const ctraits<Storage::fold>::TGstack & +KOrder::Gstack<Storage::fold>() const +{ + return _fGstack; +} template<> -ctraits<Storage::unfold>::Tm& KOrder::m<Storage::unfold>() +ctraits<Storage::unfold>::Tm & +KOrder::m<Storage::unfold>() { return _um; } template<> -const ctraits<Storage::unfold>::Tm& KOrder::m<Storage::unfold>() const -{ return _um;} +const ctraits<Storage::unfold>::Tm & +KOrder::m<Storage::unfold>() const +{ + return _um; +} template<> -ctraits<Storage::fold>::Tm& KOrder::m<Storage::fold>() +ctraits<Storage::fold>::Tm & +KOrder::m<Storage::fold>() { return _fm; } template<> -const ctraits<Storage::fold>::Tm& KOrder::m<Storage::fold>() const -{ return _fm;} +const ctraits<Storage::fold>::Tm & +KOrder::m<Storage::fold>() const +{ + return _fm; +} /* Here is the constructor of the KOrder class. We pass what we have to. The partitioning of the y vector, a sparse container with model derivatives, diff --git a/dynare++/kord/korder.hh b/dynare++/kord/korder.hh index beb423ba5d7de9804ff6e554005296a5fabd9aa0..1eb67130c822faf952a234f02a44d3d12e03d8de 100644 --- a/dynare++/kord/korder.hh +++ b/dynare++/kord/korder.hh @@ -72,7 +72,7 @@ class UnfoldedZXContainer; class FoldedGXContainer; class UnfoldedGXContainer; -template <Storage type> +template<Storage type> class ctraits { public: @@ -296,15 +296,15 @@ public: /* Performs k-order step provided that k=2 or the k−1-th step has been run, this is the core method */ - template <Storage t> + template<Storage t> void performStep(int order); /* Calculates residuals of all solved equations for k-order and reports their sizes, it is runnable after k-order performStep() has been run */ - template <Storage t> + template<Storage t> double check(int dim) const; - template <Storage t> + template<Storage t> Vector calcStochShift(int order, double sigma) const; void switchToFolded(); const PartitionY & @@ -330,7 +330,7 @@ public: protected: /* Inserts a g derivative to the g container and also creates subtensors and insert them to g_y* and g_y** containers */ - template <Storage t> + template<Storage t> void insertDerivative(std::unique_ptr<typename ctraits<t>::Ttensor> der); /* Solves the sylvester equation (templated fold, and unfold) */ @@ -339,27 +339,27 @@ protected: /* Calculates derivatives of F by Faà Di Bruno for the sparse container of system derivatives and Z stack container */ - template <Storage t> + template<Storage t> std::unique_ptr<typename ctraits<t>::Ttensor> faaDiBrunoZ(const Symmetry &sym) const; /* Calculates derivatives of G by Faà Di Bruno for the dense container g** and G stack */ - template <Storage t> + template<Storage t> std::unique_ptr<typename ctraits<t>::Ttensor> faaDiBrunoG(const Symmetry &sym) const; // Recovers g_y*ⁱ template<Storage t> void recover_y(int i); // Recovers g_y*ⁱuʲ - template <Storage t> + template<Storage t> void recover_yu(int i, int j); // Recovers g_y*ⁱσʲ - template <Storage t> + template<Storage t> void recover_ys(int i, int j); // Recovers g_y*ⁱuʲσᵏ - template <Storage t> + template<Storage t> void recover_yus(int i, int j, int k); - template <Storage t> + template<Storage t> // Recovers g_σⁱ void recover_s(int i); // Calculates specified derivatives of G and inserts them to the container @@ -367,26 +367,26 @@ protected: void fillG(int i, int j, int k); // Calculates Dᵢⱼₖ - template <Storage t> + template<Storage t> typename ctraits<t>::Ttensor calcD_ijk(int i, int j, int k) const; - template <Storage t> + template<Storage t> typename ctraits<t>::Ttensor calcD_ik(int i, int k) const; - template <Storage t> + template<Storage t> typename ctraits<t>::Ttensor calcD_k(int k) const; // Calculates Eᵢⱼₖ - template <Storage t> + template<Storage t> typename ctraits<t>::Ttensor calcE_ijk(int i, int j, int k) const; - template <Storage t> + template<Storage t> typename ctraits<t>::Ttensor calcE_ik(int i, int k) const; - template <Storage t> + template<Storage t> typename ctraits<t>::Ttensor calcE_k(int k) const; }; /* Here we insert the result to the container. Along the insertion, we also create subtensors and insert as well. */ -template <Storage t> +template<Storage t> void KOrder::insertDerivative(std::unique_ptr<typename ctraits<t>::Ttensor> der) { @@ -405,7 +405,7 @@ KOrder::insertDerivative(std::unique_ptr<typename ctraits<t>::Ttensor> der) where s is a given outer symmetry and k is the dimension of the symmetry. */ -template <Storage t> +template<Storage t> std::unique_ptr<typename ctraits<t>::Ttensor> KOrder::faaDiBrunoZ(const Symmetry &sym) const { @@ -419,7 +419,7 @@ KOrder::faaDiBrunoZ(const Symmetry &sym) const /* The same as KOrder::faaDiBrunoZ(), but for g** and G stack. */ -template <Storage t> +template<Storage t> std::unique_ptr<typename ctraits<t>::Ttensor> KOrder::faaDiBrunoG(const Symmetry &sym) const { @@ -441,7 +441,7 @@ KOrder::faaDiBrunoG(const Symmetry &sym) const Requires: everything at order ≤ i−1 Provides: g_yⁱ and G_yⁱ - */ +*/ template<Storage t> void KOrder::recover_y(int i) @@ -475,8 +475,8 @@ KOrder::recover_y(int i) Requires: everything at order ≤ i+j−1, G_yⁱ⁺ʲ and g_yⁱ⁺ʲ. Provides: g_yⁱuʲ and G_yⁱuʲ - */ -template <Storage t> +*/ +template<Storage t> void KOrder::recover_yu(int i, int j) { @@ -508,8 +508,8 @@ KOrder::recover_yu(int i, int j) Provides: g_yⁱσʲ and G_yⁱσʲ, and finally G_yⁱu′ᵐσʲ⁻ᵐ for m=1,…,j. The latter is calculated by fillG() before the actual calculation. - */ -template <Storage t> +*/ +template<Storage t> void KOrder::recover_ys(int i, int j) { @@ -561,8 +561,8 @@ KOrder::recover_ys(int i, int j) through Eᵢⱼₖ. Provides: g_yⁱuʲσᵏ, G_yⁱuʲσᵏ, and G_yⁱuʲu′ᵐσᵏ⁻ᵐ for m=1,…,k - */ -template <Storage t> +*/ +template<Storage t> void KOrder::recover_yus(int i, int j, int k) { @@ -619,8 +619,8 @@ KOrder::recover_yus(int i, int j, int k) F_u′ᵏ, and g_yᵐuʲσᵏ for j=1,…,i−1 and m+j+k=i through F_u′ʲσⁱ⁻ʲ. Provides: g_σⁱ, G_σⁱ, and G_u′ᵐσⁱ⁻ᵐ for m=1,…,i - */ -template <Storage t> +*/ +template<Storage t> void KOrder::recover_s(int i) { @@ -680,7 +680,7 @@ KOrder::fillG(int i, int j, int k) So it is non zero only for even k. */ -template <Storage t> +template<Storage t> typename ctraits<t>::Ttensor KOrder::calcD_ijk(int i, int j, int k) const { @@ -700,7 +700,7 @@ KOrder::calcD_ijk(int i, int j, int k) const ᵐ⁼¹ The sum can sum only for even m. */ -template <Storage t> +template<Storage t> typename ctraits<t>::Ttensor KOrder::calcE_ijk(int i, int j, int k) const { @@ -715,28 +715,28 @@ KOrder::calcE_ijk(int i, int j, int k) const return res; } -template <Storage t> +template<Storage t> typename ctraits<t>::Ttensor KOrder::calcD_ik(int i, int k) const { return calcD_ijk<t>(i, 0, k); } -template <Storage t> +template<Storage t> typename ctraits<t>::Ttensor KOrder::calcD_k(int k) const { return calcD_ijk<t>(0, 0, k); } -template <Storage t> +template<Storage t> typename ctraits<t>::Ttensor KOrder::calcE_ik(int i, int k) const { return calcE_ijk<t>(i, 0, k); } -template <Storage t> +template<Storage t> typename ctraits<t>::Ttensor KOrder::calcE_k(int k) const { @@ -763,7 +763,7 @@ KOrder::calcE_k(int k) const all the recovering methods, he should find out that also all G are provided. */ -template <Storage t> +template<Storage t> void KOrder::performStep(int order) { @@ -794,7 +794,7 @@ KOrder::performStep(int order) The method returns the largest residual size. Each check simply evaluates the equation. */ -template <Storage t> +template<Storage t> double KOrder::check(int dim) const { @@ -808,7 +808,7 @@ KOrder::check(int dim) const // Check for F_yⁱuʲ=0 for (int i = 0; i <= dim; i++) { - Symmetry sym{dim-i, i, 0, 0}; + Symmetry sym{dim-i, i, 0, 0}; auto r = faaDiBrunoZ<t>(sym); double err = r->getData().getMax(); JournalRecord(journal) << "\terror for symmetry " << sym << "\tis " << err << endrec; @@ -849,7 +849,7 @@ KOrder::check(int dim) const return maxerror; } -template <Storage t> +template<Storage t> Vector KOrder::calcStochShift(int order, double sigma) const { diff --git a/dynare++/kord/korder_stoch.cc b/dynare++/kord/korder_stoch.cc index 807476d0769c41f9da01564e605c70e60820c619..397dac59a75c0edfdd6b8e7ed4f42d926ee11534 100644 --- a/dynare++/kord/korder_stoch.cc +++ b/dynare++/kord/korder_stoch.cc @@ -77,112 +77,134 @@ KOrderStoch::KOrderStoch(const PartitionY &yp, int nu, // KOrderStoch convenience method specializations template<> -ctraits<Storage::unfold>::Tg &KOrderStoch::g<Storage::unfold>() +ctraits<Storage::unfold>::Tg & +KOrderStoch::g<Storage::unfold>() { return _ug; } template<> -const ctraits<Storage::unfold>::Tg &KOrderStoch::g<Storage::unfold>() const +const ctraits<Storage::unfold>::Tg & +KOrderStoch::g<Storage::unfold>() const { return _ug; } template<> -ctraits<Storage::fold>::Tg &KOrderStoch::g<Storage::fold>() +ctraits<Storage::fold>::Tg & +KOrderStoch::g<Storage::fold>() { return _fg; } template<> -const ctraits<Storage::fold>::Tg &KOrderStoch::g<Storage::fold>() const +const ctraits<Storage::fold>::Tg & +KOrderStoch::g<Storage::fold>() const { return _fg; } template<> -ctraits<Storage::unfold>::Tgs &KOrderStoch::gs<Storage::unfold>() +ctraits<Storage::unfold>::Tgs & +KOrderStoch::gs<Storage::unfold>() { return _ugs; } template<> -const ctraits<Storage::unfold>::Tgs &KOrderStoch::gs<Storage::unfold>() const +const ctraits<Storage::unfold>::Tgs & +KOrderStoch::gs<Storage::unfold>() const { return _ugs; } template<> -ctraits<Storage::fold>::Tgs &KOrderStoch::gs<Storage::fold>() +ctraits<Storage::fold>::Tgs & +KOrderStoch::gs<Storage::fold>() { return _fgs; } template<> -const ctraits<Storage::fold>::Tgs &KOrderStoch::gs<Storage::fold>() const +const ctraits<Storage::fold>::Tgs & +KOrderStoch::gs<Storage::fold>() const { return _fgs; } template<> -const ctraits<Storage::unfold>::Tgss &KOrderStoch::h<Storage::unfold>() const +const ctraits<Storage::unfold>::Tgss & +KOrderStoch::h<Storage::unfold>() const { return *_uh; } template<> -const ctraits<Storage::fold>::Tgss &KOrderStoch::h<Storage::fold>() const +const ctraits<Storage::fold>::Tgss & +KOrderStoch::h<Storage::fold>() const { return *_fh; } template<> -ctraits<Storage::unfold>::TG &KOrderStoch::G<Storage::unfold>() +ctraits<Storage::unfold>::TG & +KOrderStoch::G<Storage::unfold>() { return _uG; } template<> -const ctraits<Storage::unfold>::TG &KOrderStoch::G<Storage::unfold>() const +const ctraits<Storage::unfold>::TG & +KOrderStoch::G<Storage::unfold>() const { return _uG; } template<> -ctraits<Storage::fold>::TG &KOrderStoch::G<Storage::fold>() +ctraits<Storage::fold>::TG & +KOrderStoch::G<Storage::fold>() { return _fG; } template<> -const ctraits<Storage::fold>::TG& KOrderStoch::G<Storage::fold>() const +const ctraits<Storage::fold>::TG & +KOrderStoch::G<Storage::fold>() const { return _fG; } template<> -ctraits<Storage::unfold>::TZXstack &KOrderStoch::Zstack<Storage::unfold>() +ctraits<Storage::unfold>::TZXstack & +KOrderStoch::Zstack<Storage::unfold>() { return _uZstack; } template<> -const ctraits<Storage::unfold>::TZXstack &KOrderStoch::Zstack<Storage::unfold>() const +const ctraits<Storage::unfold>::TZXstack & +KOrderStoch::Zstack<Storage::unfold>() const { return _uZstack; } template<> -ctraits<Storage::fold>::TZXstack &KOrderStoch::Zstack<Storage::fold>() +ctraits<Storage::fold>::TZXstack & +KOrderStoch::Zstack<Storage::fold>() { return _fZstack; } template<> -const ctraits<Storage::fold>::TZXstack &KOrderStoch::Zstack<Storage::fold>() const +const ctraits<Storage::fold>::TZXstack & +KOrderStoch::Zstack<Storage::fold>() const { return _fZstack; } template<> -ctraits<Storage::unfold>::TGXstack &KOrderStoch::Gstack<Storage::unfold>() +ctraits<Storage::unfold>::TGXstack & +KOrderStoch::Gstack<Storage::unfold>() { return _uGstack; } template<> -const ctraits<Storage::unfold>::TGXstack &KOrderStoch::Gstack<Storage::unfold>() const +const ctraits<Storage::unfold>::TGXstack & +KOrderStoch::Gstack<Storage::unfold>() const { return _uGstack; } template<> -ctraits<Storage::fold>::TGXstack &KOrderStoch::Gstack<Storage::fold>() +ctraits<Storage::fold>::TGXstack & +KOrderStoch::Gstack<Storage::fold>() { return _fGstack; } template<> -const ctraits<Storage::fold>::TGXstack &KOrderStoch::Gstack<Storage::fold>() const +const ctraits<Storage::fold>::TGXstack & +KOrderStoch::Gstack<Storage::fold>() const { return _fGstack; } diff --git a/dynare++/kord/korder_stoch.hh b/dynare++/kord/korder_stoch.hh index 5860809d3c58fc0417114655920a1bfbf6aa875d..a450f2bda9ab3ed8fd7896a9b79c27e47fc9534a 100644 --- a/dynare++/kord/korder_stoch.hh +++ b/dynare++/kord/korder_stoch.hh @@ -36,7 +36,7 @@ containers corresponding to f(h(g*(y*,u,σ),σ),g(y,u,σ),y,u). Further, we declare IntegDerivs and StochForwardDerivs classes which basically calculate h as an extrapolation based on an approximation to g at lower σ. - */ +*/ #include <memory> @@ -48,7 +48,7 @@ /* This class is a container, which has a specialized constructor integrating the policy rule at given σ. */ -template <Storage t> +template<Storage t> class IntegDerivs : public ctraits<t>::Tgss { public: @@ -100,8 +100,8 @@ public: ⁿ⁺ᵏ⁼ᵖ and this is exactly what the code does. - */ -template <Storage t> +*/ +template<Storage t> IntegDerivs<t>::IntegDerivs(int r, const IntSequence &nvs, const typename ctraits<t>::Tgss &g, const typename ctraits<t>::Tm &mom, double at_sigma) : ctraits<t>::Tgss(4) @@ -156,7 +156,7 @@ IntegDerivs<t>::IntegDerivs(int r, const IntSequence &nvs, const typename ctrait The class calculates derivatives of E[g(y*,u,σ)] at (ȳ*,σ¯). The derivatives are extrapolated based on derivatives at (ỹ*,σ~). */ -template <Storage t> +template<Storage t> class StochForwardDerivs : public ctraits<t>::Tgss { public: @@ -180,7 +180,7 @@ public: — Centralize this polynomial about (ȳ,σ¯) — Recover general symmetry tensors from the (full symmetric) polynomial */ -template <Storage t> +template<Storage t> StochForwardDerivs<t>::StochForwardDerivs(const PartitionY &ypart, int nu, const typename ctraits<t>::Tgss &g, const typename ctraits<t>::Tm &m, @@ -260,7 +260,7 @@ StochForwardDerivs<t>::StochForwardDerivs(const PartitionY &ypart, int nu, the σ as a second argument to h will be its fourth variable in symmetry, so we have to do four member stack having the second and third stack dummy. */ -template <class _Ttype> +template<class _Ttype> class GXContainer : public GContainer<_Ttype> { public: @@ -279,8 +279,8 @@ public: ⎢ dummy ⎥ ⎢ dummy ⎥ ⎣ σ ⎦ - */ -template <class _Ttype> +*/ +template<class _Ttype> typename GXContainer<_Ttype>::itype GXContainer<_Ttype>::getType(int i, const Symmetry &s) const { @@ -306,7 +306,7 @@ GXContainer<_Ttype>::getType(int i, const Symmetry &s) const the size (number of rows) as g**. Since it is very simmilar to ZContainer, we inherit form it and override only getType() method. */ -template <class _Ttype> +template<class _Ttype> class ZXContainer : public ZContainer<_Ttype> { public: @@ -326,7 +326,7 @@ public: ⎢ y ⎥ ⎣ u ⎦ */ -template <class _Ttype> +template<class _Ttype> typename ZXContainer<_Ttype>::itype ZXContainer<_Ttype>::getType(int i, const Symmetry &s) const { @@ -446,7 +446,7 @@ public: const FGSContainer &hh, Journal &jr); KOrderStoch(const PartitionY &ypart, int nu, const TensorContainer<FSSparseTensor> &fcont, const UGSContainer &hh, Journal &jr); - template <Storage t> + template<Storage t> void performStep(int order); const FGSContainer & getFoldDers() const @@ -459,9 +459,9 @@ public: return _ug; } protected: - template <Storage t> + template<Storage t> std::unique_ptr<typename ctraits<t>::Ttensor> faaDiBrunoZ(const Symmetry &sym) const; - template <Storage t> + template<Storage t> std::unique_ptr<typename ctraits<t>::Ttensor> faaDiBrunoG(const Symmetry &sym) const; // Convenience access methods @@ -497,7 +497,7 @@ protected: /* This calculates a derivative of f(G(y,u,σ),g(y,u,σ),y,u) of a given symmetry. */ -template <Storage t> +template<Storage t> std::unique_ptr<typename ctraits<t>::Ttensor> KOrderStoch::faaDiBrunoZ(const Symmetry &sym) const { @@ -512,7 +512,7 @@ KOrderStoch::faaDiBrunoZ(const Symmetry &sym) const /* This calculates a derivative of G(y,u,σ)=h(g*(y,u,σ),σ) of a given symmetry. */ -template <Storage t> +template<Storage t> std::unique_ptr<typename ctraits<t>::Ttensor> KOrderStoch::faaDiBrunoG(const Symmetry &sym) const { @@ -535,7 +535,7 @@ KOrderStoch::faaDiBrunoG(const Symmetry &sym) const as gₛ=-matA⁻¹·RHS. Finally we have to update Gₛ by calling Gstack<t>().multAndAdd(1, h<t>(), *G_sym_ptr). */ -template <Storage t> +template<Storage t> void KOrderStoch::performStep(int order) { diff --git a/dynare++/kord/tests.cc b/dynare++/kord/tests.cc index 1cadbe3b9345d9badd47487e42ec789fa1ead8e2..9827eba95767fca1469337a9b58fa9fb64b3049c 100644 --- a/dynare++/kord/tests.cc +++ b/dynare++/kord/tests.cc @@ -116,141 +116,147 @@ SparseGenerator::fillContainer(TensorContainer<FSSparseTensor> &c, } } -const double vdata [] = { // 3x3 - 0.1307870268, 0.1241940078, 0.1356703123, - 0.1241940078, 0.1986920419, 0.2010160581, - 0.1356703123, 0.2010160581, 0.2160336975 -}; - -const double gy_data [] = { // 8x4 - 0.3985178619, -0.5688233582, 0.9572900437, -0.6606847776, 0.1453004017, - 0.3025310675, -0.8627437750, -0.6903410191, 0.4751910580, -0.7270018589, - -0.0939612498, -0.1463831989, 0.6742110220, 0.6046671043, 0.5215893126, - -1.0412969986, -0.3524898417, -1.0986703430, 0.8006531522, 0.8879776376, - -0.1037608317, -0.5587378073, -0.1010366945, 0.9462411248, -0.2439199881, - 1.3420621236, -0.7820285935, 0.3205293447, 0.3606124791, 0.2975422208, - -0.5452861965, 1.6320340279 -}; - -const double gu_data [] = { // just some numbers, no structure - 1.8415286914, -0.2638743845, 1.7690713274, 0.9668585956, 0.2303143646, - -0.2229624279, -0.4381991822, 1.0082401405, -0.3186555860, -0.0624691529, - -0.5189085756, 1.4269672156, 0.1163282969, 1.4020183445, -0.0952660426, - 0.2099097124, 0.6912400502, -0.5180935114, 0.5288316624, 0.2188053448, - 0.5715516767, 0.7813893410, -0.6385073106, 0.8335131513, 0.3605202168, - -1.1167944865, -1.2263750934, 0.6113636081, 0.6964915482, -0.6451217688, - 0.4062810500, -2.0552251116, -1.6383406284, 0.0198915095, 0.0111014458, - -1.2421792262, -1.0724161722, -0.4276904972, 0.1801494950, -2.0716473264 -}; - -const double vdata2 [] = { // 10×10 positive definite - 0.79666, -0.15536, 0.05667, -0.21026, 0.20262, 0.28505, 0.60341, -0.09703, 0.32363, 0.13299, - -0.15536, 0.64380, -0.01131, 0.00980, 0.03755, 0.43791, 0.21784, -0.31755, -0.55911, -0.29655, - 0.05667, -0.01131, 0.56165, -0.34357, -0.40584, 0.20990, 0.28348, 0.20398, -0.19856, 0.35820, - -0.21026, 0.00980, -0.34357, 0.56147, 0.10972, -0.34146, -0.49906, -0.19685, 0.21088, -0.31560, - 0.20262, 0.03755, -0.40584, 0.10972, 0.72278, 0.02155, 0.04089, -0.19696, 0.03446, -0.12919, - 0.28505, 0.43791, 0.20990, -0.34146, 0.02155, 0.75867, 0.77699, -0.31125, -0.55141, -0.02155, - 0.60341, 0.21784, 0.28348, -0.49906, 0.04089, 0.77699, 1.34553, -0.18613, -0.25811, -0.19016, - -0.09703, -0.31755, 0.20398, -0.19685, -0.19696, -0.31125, -0.18613, 0.59470, 0.08386, 0.41750, - 0.32363, -0.55911, -0.19856, 0.21088, 0.03446, -0.55141, -0.25811, 0.08386, 0.98917, -0.12992, - 0.13299, -0.29655, 0.35820, -0.31560, -0.12919, -0.02155, -0.19016, 0.41750, -0.12992, 0.89608 -}; - -const double gy_data2 [] = { // 600 items make gy 30×20, whose gy(6:25,:) has spectrum within unit - 0.39414, -0.29766, 0.08948, -0.19204, -0.00750, 0.21159, 0.05494, 0.06225, 0.01771, 0.21913, - -0.01373, 0.20086, -0.06086, -0.10955, 0.14424, -0.08390, 0.03948, -0.14713, 0.11674, 0.05091, - 0.24039, 0.28307, -0.11835, 0.13030, 0.11682, -0.27444, -0.19311, -0.16654, 0.12867, 0.25116, - -0.19781, 0.45242, -0.15862, 0.24428, -0.11966, 0.11483, -0.32279, 0.29727, 0.20934, -0.18190, - -0.15080, -0.09477, -0.30551, -0.02672, -0.26919, 0.11165, -0.06390, 0.03449, -0.26622, 0.22197, - 0.45141, -0.41683, 0.09760, 0.31094, -0.01652, 0.05809, -0.04514, -0.05645, 0.00554, 0.47980, - 0.11726, 0.42459, -0.13136, -0.30902, -0.14648, 0.11455, 0.02947, -0.03835, -0.04044, 0.03559, - -0.26575, -0.01783, 0.31243, -0.14412, -0.13218, -0.05080, 0.18576, 0.13840, -0.05560, 0.35530, - -0.25573, -0.11560, 0.15187, -0.18431, 0.08193, -0.32278, 0.17560, -0.05529, -0.10020, -0.23088, - -0.20979, -0.49245, 0.09915, -0.16909, -0.03443, 0.19497, 0.18473, 0.25662, 0.29605, -0.20531, - -0.39244, -0.43369, 0.05588, 0.24823, -0.14236, -0.08311, 0.16371, -0.19975, 0.30605, -0.17087, - -0.01270, 0.00123, -0.22426, -0.13810, 0.05079, 0.06971, 0.01922, -0.09952, -0.23177, -0.41962, - -0.41991, 0.41430, -0.04247, -0.13706, -0.12048, -0.28906, -0.22813, -0.25057, -0.18579, -0.20642, - -0.47976, 0.25490, -0.05138, -0.30794, 0.31651, 0.02034, 0.12954, -0.20110, 0.13336, -0.40775, - -0.30195, -0.13704, 0.12396, 0.28152, 0.02986, 0.27669, 0.24623, 0.08635, -0.11956, -0.02949, - 0.37401, 0.20838, 0.24801, -0.26872, 0.11195, 0.00315, -0.19069, 0.12839, -0.23036, -0.48228, - 0.08434, -0.39872, -0.28896, -0.28754, 0.24668, 0.23285, 0.25437, 0.10456, -0.14124, 0.20483, - -0.19117, -0.33836, -0.24875, 0.08207, -0.03930, 0.20364, 0.15384, -0.15270, 0.24372, -0.11199, - -0.46591, 0.30319, 0.05745, 0.09084, 0.06058, 0.31884, 0.05071, -0.28899, -0.30793, -0.03566, - 0.02286, 0.28178, 0.00736, -0.31378, -0.18144, -0.22346, -0.27239, 0.31043, -0.26228, 0.22181, - -0.15096, -0.36953, -0.06032, 0.21496, 0.29545, -0.13112, 0.16420, -0.07573, -0.43111, -0.43057, - 0.26716, -0.31209, -0.05866, -0.29101, -0.27437, -0.18727, 0.28732, -0.19014, 0.08837, 0.30405, - 0.06103, -0.35612, 0.00173, 0.25134, -0.08987, -0.22766, -0.03254, -0.18662, -0.08491, 0.49401, - -0.12145, -0.02961, -0.03668, -0.30043, -0.08555, 0.01701, -0.12544, 0.10969, -0.48202, 0.07245, - 0.20673, 0.11408, 0.04343, -0.01815, -0.31594, -0.23632, -0.06258, -0.27474, 0.12180, 0.16613, - -0.37931, 0.30219, 0.15765, 0.25489, 0.17529, -0.17020, -0.30060, 0.22058, -0.02450, -0.42143, - 0.49642, 0.46899, -0.28552, -0.22549, -0.01333, 0.21567, 0.22251, 0.21639, -0.19194, -0.19140, - -0.24106, 0.10952, -0.11019, 0.29763, -0.02039, -0.25748, 0.23169, 0.01357, 0.09802, -0.19022, - 0.37604, -0.40777, 0.18131, -0.10258, 0.29573, -0.31773, 0.09069, -0.02198, -0.26594, 0.48302, - -0.10041, 0.20210, -0.05609, -0.01169, -0.17339, 0.17862, -0.22502, 0.29009, -0.45160, 0.19771, - 0.27634, 0.31695, -0.09993, 0.17167, 0.12394, 0.28088, -0.12502, -0.16967, -0.06296, -0.17036, - 0.27320, 0.01595, 0.16955, 0.30146, -0.15173, -0.29807, 0.08178, -0.06811, 0.21655, 0.26348, - 0.06316, 0.45661, -0.29756, -0.05742, -0.14715, -0.03037, -0.16656, -0.08768, 0.38078, 0.40679, - -0.32779, -0.09106, 0.16107, -0.07301, 0.07700, -0.22694, -0.15692, -0.02548, 0.38749, -0.12203, - -0.02980, -0.22067, 0.00680, -0.23058, -0.29112, 0.23032, -0.16026, 0.23392, -0.09990, 0.03628, - -0.42592, -0.33474, -0.09499, -0.17442, -0.20110, 0.24618, -0.06418, -0.06715, 0.40754, 0.29377, - 0.29543, -0.16832, -0.08468, 0.06491, -0.01410, 0.19988, 0.24950, 0.14626, -0.27851, 0.06079, - 0.48134, -0.13475, 0.25398, 0.11738, 0.23369, -0.00661, -0.16811, -0.04557, -0.12030, -0.39527, - -0.35760, 0.01840, -0.15941, 0.03290, 0.09988, -0.08307, 0.06644, -0.24637, 0.34112, -0.08026, - 0.00951, 0.27656, 0.16247, 0.28217, 0.17198, -0.16389, -0.03835, -0.02675, -0.08032, -0.21045, - -0.38946, 0.23207, 0.10987, -0.31674, -0.28653, -0.27430, -0.29109, -0.00648, 0.38431, -0.38478, - -0.41195, -0.19364, -0.20977, -0.05524, 0.05558, -0.20109, 0.11803, -0.19884, 0.43318, -0.39255, - 0.26612, -0.21771, 0.12471, 0.12856, -0.15104, -0.11676, 0.17582, -0.25330, 0.00298, -0.31712, - 0.21532, -0.20319, 0.14507, -0.04588, -0.22995, -0.06470, 0.18849, -0.13444, 0.37107, 0.07387, - -0.14008, 0.09896, 0.13727, -0.28417, -0.09461, -0.18703, 0.04080, 0.02343, -0.49988, 0.17993, - 0.23189, -0.30581, -0.18334, -0.09667, -0.27699, -0.05998, 0.09118, -0.32453, 0.46251, 0.41500, - -0.45314, -0.00544, 0.08529, 0.29099, -0.00937, -0.31650, 0.26163, 0.14506, 0.37498, -0.16454, - 0.35215, 0.31642, -0.09161, -0.31452, -0.04792, -0.04677, -0.19523, 0.27998, 0.05491, 0.44461, - -0.01258, -0.27887, 0.18361, -0.04539, -0.02977, 0.30821, 0.29454, -0.17932, 0.16193, 0.23934, - 0.47923, 0.25373, 0.23258, 0.31484, -0.17958, -0.01136, 0.17681, 0.12869, 0.03235, 0.43762, - 0.13734, -0.09433, -0.03735, 0.17949, 0.14122, -0.17814, 0.06359, 0.16044, 0.12249, -0.22314, - 0.40775, 0.05147, 0.12389, 0.04290, -0.01642, 0.00082, -0.18056, 0.02875, 0.32690, 0.17712, - 0.34001, -0.21581, -0.01086, -0.18180, 0.17480, -0.17774, -0.07503, 0.28438, -0.19747, 0.29595, - -0.28002, -0.02073, -0.16522, -0.18234, -0.20565, 0.29620, 0.07502, 0.01429, -0.31418, 0.43693, - -0.12212, 0.11178, -0.28503, 0.04683, 0.00072, 0.05566, 0.18857, 0.26101, -0.38891, -0.21216, - -0.21850, -0.15147, -0.30749, -0.23762, 0.14984, 0.03535, -0.02862, -0.00105, -0.39907, -0.06909, - -0.36094, 0.21717, 0.15930, -0.18924, 0.13741, 0.01039, 0.13613, 0.00659, 0.07676, -0.13711, - 0.24285, -0.07564, -0.28349, -0.15658, 0.03135, -0.30909, -0.22534, 0.17363, -0.19376, 0.26038, - 0.05546, -0.22607, 0.32420, -0.02552, -0.05400, 0.13388, 0.04643, -0.31535, -0.06181, 0.30237, - -0.04680, -0.29441, 0.12231, 0.03960, -0.01188, 0.01406, 0.25402, 0.03315, 0.25026, -0.10922 -}; - -const double gu_data2 [] = { // raw data 300 items - 0.26599, 0.41329, 0.31846, 0.92590, 0.43050, 0.17466, 0.02322, 0.72621, 0.37921, 0.70597, - 0.97098, 0.14023, 0.57619, 0.09938, 0.02281, 0.92341, 0.72654, 0.71000, 0.76687, 0.70182, - 0.88752, 0.49524, 0.42549, 0.42806, 0.57615, 0.76051, 0.15341, 0.47457, 0.60066, 0.40880, - 0.20668, 0.41949, 0.97620, 0.94318, 0.71491, 0.56402, 0.23553, 0.94387, 0.78567, 0.06362, - 0.85252, 0.86262, 0.25190, 0.03274, 0.93216, 0.37971, 0.08797, 0.14596, 0.73871, 0.06574, - 0.67447, 0.28575, 0.43911, 0.92133, 0.12327, 0.87762, 0.71060, 0.07141, 0.55443, 0.53310, - 0.91529, 0.25121, 0.07593, 0.94490, 0.28656, 0.82174, 0.68887, 0.67337, 0.99291, 0.03316, - 0.02849, 0.33891, 0.25594, 0.90071, 0.01248, 0.67871, 0.65953, 0.65369, 0.97574, 0.31578, - 0.23678, 0.39220, 0.06706, 0.80943, 0.57694, 0.08220, 0.18151, 0.19969, 0.37096, 0.37858, - 0.70153, 0.46816, 0.76511, 0.02520, 0.39387, 0.25527, 0.39050, 0.60141, 0.30322, 0.46195, - 0.12025, 0.33616, 0.04174, 0.00196, 0.68886, 0.74445, 0.15869, 0.18994, 0.95195, 0.62874, - 0.82874, 0.53369, 0.34383, 0.50752, 0.97023, 0.22695, 0.62407, 0.25840, 0.71279, 0.28785, - 0.31611, 0.20391, 0.19702, 0.40760, 0.85158, 0.68369, 0.63760, 0.09879, 0.11924, 0.32920, - 0.53052, 0.15900, 0.21229, 0.84080, 0.33933, 0.93651, 0.42705, 0.06199, 0.50092, 0.47192, - 0.57152, 0.01818, 0.31404, 0.50173, 0.87725, 0.50530, 0.10717, 0.04035, 0.32901, 0.33538, - 0.04780, 0.40984, 0.78216, 0.91288, 0.11314, 0.25248, 0.23823, 0.74001, 0.48089, 0.55531, - 0.82486, 0.01058, 0.05409, 0.44357, 0.52641, 0.68188, 0.94629, 0.61627, 0.33037, 0.11961, - 0.57988, 0.19653, 0.91902, 0.59838, 0.52974, 0.28364, 0.45767, 0.65836, 0.63045, 0.76140, - 0.27918, 0.27256, 0.46035, 0.77418, 0.92918, 0.14095, 0.89645, 0.25146, 0.21172, 0.47910, - 0.95451, 0.34377, 0.29927, 0.79220, 0.97654, 0.67591, 0.44385, 0.38434, 0.44860, 0.28170, - 0.90712, 0.20337, 0.00292, 0.55046, 0.62255, 0.45127, 0.80896, 0.43965, 0.59145, 0.23801, - 0.33601, 0.30119, 0.89935, 0.40850, 0.98226, 0.75430, 0.68318, 0.65407, 0.68067, 0.32942, - 0.11756, 0.27626, 0.83879, 0.72174, 0.75430, 0.13702, 0.03402, 0.58781, 0.07393, 0.23067, - 0.92537, 0.29445, 0.43437, 0.47685, 0.54548, 0.66082, 0.23805, 0.60208, 0.94337, 0.21363, - 0.72637, 0.57181, 0.77679, 0.63931, 0.72860, 0.38901, 0.94920, 0.04535, 0.12863, 0.40550, - 0.90095, 0.21418, 0.13953, 0.99639, 0.02526, 0.70018, 0.21828, 0.20294, 0.20191, 0.30954, - 0.39490, 0.68955, 0.11506, 0.15748, 0.40252, 0.91680, 0.61547, 0.78443, 0.19693, 0.67630, - 0.56552, 0.58556, 0.53554, 0.53507, 0.09831, 0.21229, 0.83135, 0.26375, 0.89287, 0.97069, - 0.70615, 0.42041, 0.43117, 0.21291, 0.26086, 0.26978, 0.77340, 0.43833, 0.46179, 0.54418, - 0.67878, 0.42776, 0.61454, 0.55915, 0.36363, 0.31999, 0.42442, 0.86649, 0.62513, 0.02047 -}; +const double vdata[] = + { // 3x3 + 0.1307870268, 0.1241940078, 0.1356703123, + 0.1241940078, 0.1986920419, 0.2010160581, + 0.1356703123, 0.2010160581, 0.2160336975 + }; + +const double gy_data[] = + { // 8x4 + 0.3985178619, -0.5688233582, 0.9572900437, -0.6606847776, 0.1453004017, + 0.3025310675, -0.8627437750, -0.6903410191, 0.4751910580, -0.7270018589, + -0.0939612498, -0.1463831989, 0.6742110220, 0.6046671043, 0.5215893126, + -1.0412969986, -0.3524898417, -1.0986703430, 0.8006531522, 0.8879776376, + -0.1037608317, -0.5587378073, -0.1010366945, 0.9462411248, -0.2439199881, + 1.3420621236, -0.7820285935, 0.3205293447, 0.3606124791, 0.2975422208, + -0.5452861965, 1.6320340279 + }; + +const double gu_data[] = + { // just some numbers, no structure + 1.8415286914, -0.2638743845, 1.7690713274, 0.9668585956, 0.2303143646, + -0.2229624279, -0.4381991822, 1.0082401405, -0.3186555860, -0.0624691529, + -0.5189085756, 1.4269672156, 0.1163282969, 1.4020183445, -0.0952660426, + 0.2099097124, 0.6912400502, -0.5180935114, 0.5288316624, 0.2188053448, + 0.5715516767, 0.7813893410, -0.6385073106, 0.8335131513, 0.3605202168, + -1.1167944865, -1.2263750934, 0.6113636081, 0.6964915482, -0.6451217688, + 0.4062810500, -2.0552251116, -1.6383406284, 0.0198915095, 0.0111014458, + -1.2421792262, -1.0724161722, -0.4276904972, 0.1801494950, -2.0716473264 + }; + +const double vdata2[] = + { // 10×10 positive definite + 0.79666, -0.15536, 0.05667, -0.21026, 0.20262, 0.28505, 0.60341, -0.09703, 0.32363, 0.13299, + -0.15536, 0.64380, -0.01131, 0.00980, 0.03755, 0.43791, 0.21784, -0.31755, -0.55911, -0.29655, + 0.05667, -0.01131, 0.56165, -0.34357, -0.40584, 0.20990, 0.28348, 0.20398, -0.19856, 0.35820, + -0.21026, 0.00980, -0.34357, 0.56147, 0.10972, -0.34146, -0.49906, -0.19685, 0.21088, -0.31560, + 0.20262, 0.03755, -0.40584, 0.10972, 0.72278, 0.02155, 0.04089, -0.19696, 0.03446, -0.12919, + 0.28505, 0.43791, 0.20990, -0.34146, 0.02155, 0.75867, 0.77699, -0.31125, -0.55141, -0.02155, + 0.60341, 0.21784, 0.28348, -0.49906, 0.04089, 0.77699, 1.34553, -0.18613, -0.25811, -0.19016, + -0.09703, -0.31755, 0.20398, -0.19685, -0.19696, -0.31125, -0.18613, 0.59470, 0.08386, 0.41750, + 0.32363, -0.55911, -0.19856, 0.21088, 0.03446, -0.55141, -0.25811, 0.08386, 0.98917, -0.12992, + 0.13299, -0.29655, 0.35820, -0.31560, -0.12919, -0.02155, -0.19016, 0.41750, -0.12992, 0.89608 + }; + +const double gy_data2[] = + { // 600 items make gy 30×20, whose gy(6:25,:) has spectrum within unit + 0.39414, -0.29766, 0.08948, -0.19204, -0.00750, 0.21159, 0.05494, 0.06225, 0.01771, 0.21913, + -0.01373, 0.20086, -0.06086, -0.10955, 0.14424, -0.08390, 0.03948, -0.14713, 0.11674, 0.05091, + 0.24039, 0.28307, -0.11835, 0.13030, 0.11682, -0.27444, -0.19311, -0.16654, 0.12867, 0.25116, + -0.19781, 0.45242, -0.15862, 0.24428, -0.11966, 0.11483, -0.32279, 0.29727, 0.20934, -0.18190, + -0.15080, -0.09477, -0.30551, -0.02672, -0.26919, 0.11165, -0.06390, 0.03449, -0.26622, 0.22197, + 0.45141, -0.41683, 0.09760, 0.31094, -0.01652, 0.05809, -0.04514, -0.05645, 0.00554, 0.47980, + 0.11726, 0.42459, -0.13136, -0.30902, -0.14648, 0.11455, 0.02947, -0.03835, -0.04044, 0.03559, + -0.26575, -0.01783, 0.31243, -0.14412, -0.13218, -0.05080, 0.18576, 0.13840, -0.05560, 0.35530, + -0.25573, -0.11560, 0.15187, -0.18431, 0.08193, -0.32278, 0.17560, -0.05529, -0.10020, -0.23088, + -0.20979, -0.49245, 0.09915, -0.16909, -0.03443, 0.19497, 0.18473, 0.25662, 0.29605, -0.20531, + -0.39244, -0.43369, 0.05588, 0.24823, -0.14236, -0.08311, 0.16371, -0.19975, 0.30605, -0.17087, + -0.01270, 0.00123, -0.22426, -0.13810, 0.05079, 0.06971, 0.01922, -0.09952, -0.23177, -0.41962, + -0.41991, 0.41430, -0.04247, -0.13706, -0.12048, -0.28906, -0.22813, -0.25057, -0.18579, -0.20642, + -0.47976, 0.25490, -0.05138, -0.30794, 0.31651, 0.02034, 0.12954, -0.20110, 0.13336, -0.40775, + -0.30195, -0.13704, 0.12396, 0.28152, 0.02986, 0.27669, 0.24623, 0.08635, -0.11956, -0.02949, + 0.37401, 0.20838, 0.24801, -0.26872, 0.11195, 0.00315, -0.19069, 0.12839, -0.23036, -0.48228, + 0.08434, -0.39872, -0.28896, -0.28754, 0.24668, 0.23285, 0.25437, 0.10456, -0.14124, 0.20483, + -0.19117, -0.33836, -0.24875, 0.08207, -0.03930, 0.20364, 0.15384, -0.15270, 0.24372, -0.11199, + -0.46591, 0.30319, 0.05745, 0.09084, 0.06058, 0.31884, 0.05071, -0.28899, -0.30793, -0.03566, + 0.02286, 0.28178, 0.00736, -0.31378, -0.18144, -0.22346, -0.27239, 0.31043, -0.26228, 0.22181, + -0.15096, -0.36953, -0.06032, 0.21496, 0.29545, -0.13112, 0.16420, -0.07573, -0.43111, -0.43057, + 0.26716, -0.31209, -0.05866, -0.29101, -0.27437, -0.18727, 0.28732, -0.19014, 0.08837, 0.30405, + 0.06103, -0.35612, 0.00173, 0.25134, -0.08987, -0.22766, -0.03254, -0.18662, -0.08491, 0.49401, + -0.12145, -0.02961, -0.03668, -0.30043, -0.08555, 0.01701, -0.12544, 0.10969, -0.48202, 0.07245, + 0.20673, 0.11408, 0.04343, -0.01815, -0.31594, -0.23632, -0.06258, -0.27474, 0.12180, 0.16613, + -0.37931, 0.30219, 0.15765, 0.25489, 0.17529, -0.17020, -0.30060, 0.22058, -0.02450, -0.42143, + 0.49642, 0.46899, -0.28552, -0.22549, -0.01333, 0.21567, 0.22251, 0.21639, -0.19194, -0.19140, + -0.24106, 0.10952, -0.11019, 0.29763, -0.02039, -0.25748, 0.23169, 0.01357, 0.09802, -0.19022, + 0.37604, -0.40777, 0.18131, -0.10258, 0.29573, -0.31773, 0.09069, -0.02198, -0.26594, 0.48302, + -0.10041, 0.20210, -0.05609, -0.01169, -0.17339, 0.17862, -0.22502, 0.29009, -0.45160, 0.19771, + 0.27634, 0.31695, -0.09993, 0.17167, 0.12394, 0.28088, -0.12502, -0.16967, -0.06296, -0.17036, + 0.27320, 0.01595, 0.16955, 0.30146, -0.15173, -0.29807, 0.08178, -0.06811, 0.21655, 0.26348, + 0.06316, 0.45661, -0.29756, -0.05742, -0.14715, -0.03037, -0.16656, -0.08768, 0.38078, 0.40679, + -0.32779, -0.09106, 0.16107, -0.07301, 0.07700, -0.22694, -0.15692, -0.02548, 0.38749, -0.12203, + -0.02980, -0.22067, 0.00680, -0.23058, -0.29112, 0.23032, -0.16026, 0.23392, -0.09990, 0.03628, + -0.42592, -0.33474, -0.09499, -0.17442, -0.20110, 0.24618, -0.06418, -0.06715, 0.40754, 0.29377, + 0.29543, -0.16832, -0.08468, 0.06491, -0.01410, 0.19988, 0.24950, 0.14626, -0.27851, 0.06079, + 0.48134, -0.13475, 0.25398, 0.11738, 0.23369, -0.00661, -0.16811, -0.04557, -0.12030, -0.39527, + -0.35760, 0.01840, -0.15941, 0.03290, 0.09988, -0.08307, 0.06644, -0.24637, 0.34112, -0.08026, + 0.00951, 0.27656, 0.16247, 0.28217, 0.17198, -0.16389, -0.03835, -0.02675, -0.08032, -0.21045, + -0.38946, 0.23207, 0.10987, -0.31674, -0.28653, -0.27430, -0.29109, -0.00648, 0.38431, -0.38478, + -0.41195, -0.19364, -0.20977, -0.05524, 0.05558, -0.20109, 0.11803, -0.19884, 0.43318, -0.39255, + 0.26612, -0.21771, 0.12471, 0.12856, -0.15104, -0.11676, 0.17582, -0.25330, 0.00298, -0.31712, + 0.21532, -0.20319, 0.14507, -0.04588, -0.22995, -0.06470, 0.18849, -0.13444, 0.37107, 0.07387, + -0.14008, 0.09896, 0.13727, -0.28417, -0.09461, -0.18703, 0.04080, 0.02343, -0.49988, 0.17993, + 0.23189, -0.30581, -0.18334, -0.09667, -0.27699, -0.05998, 0.09118, -0.32453, 0.46251, 0.41500, + -0.45314, -0.00544, 0.08529, 0.29099, -0.00937, -0.31650, 0.26163, 0.14506, 0.37498, -0.16454, + 0.35215, 0.31642, -0.09161, -0.31452, -0.04792, -0.04677, -0.19523, 0.27998, 0.05491, 0.44461, + -0.01258, -0.27887, 0.18361, -0.04539, -0.02977, 0.30821, 0.29454, -0.17932, 0.16193, 0.23934, + 0.47923, 0.25373, 0.23258, 0.31484, -0.17958, -0.01136, 0.17681, 0.12869, 0.03235, 0.43762, + 0.13734, -0.09433, -0.03735, 0.17949, 0.14122, -0.17814, 0.06359, 0.16044, 0.12249, -0.22314, + 0.40775, 0.05147, 0.12389, 0.04290, -0.01642, 0.00082, -0.18056, 0.02875, 0.32690, 0.17712, + 0.34001, -0.21581, -0.01086, -0.18180, 0.17480, -0.17774, -0.07503, 0.28438, -0.19747, 0.29595, + -0.28002, -0.02073, -0.16522, -0.18234, -0.20565, 0.29620, 0.07502, 0.01429, -0.31418, 0.43693, + -0.12212, 0.11178, -0.28503, 0.04683, 0.00072, 0.05566, 0.18857, 0.26101, -0.38891, -0.21216, + -0.21850, -0.15147, -0.30749, -0.23762, 0.14984, 0.03535, -0.02862, -0.00105, -0.39907, -0.06909, + -0.36094, 0.21717, 0.15930, -0.18924, 0.13741, 0.01039, 0.13613, 0.00659, 0.07676, -0.13711, + 0.24285, -0.07564, -0.28349, -0.15658, 0.03135, -0.30909, -0.22534, 0.17363, -0.19376, 0.26038, + 0.05546, -0.22607, 0.32420, -0.02552, -0.05400, 0.13388, 0.04643, -0.31535, -0.06181, 0.30237, + -0.04680, -0.29441, 0.12231, 0.03960, -0.01188, 0.01406, 0.25402, 0.03315, 0.25026, -0.10922 + }; + +const double gu_data2[] = + { // raw data 300 items + 0.26599, 0.41329, 0.31846, 0.92590, 0.43050, 0.17466, 0.02322, 0.72621, 0.37921, 0.70597, + 0.97098, 0.14023, 0.57619, 0.09938, 0.02281, 0.92341, 0.72654, 0.71000, 0.76687, 0.70182, + 0.88752, 0.49524, 0.42549, 0.42806, 0.57615, 0.76051, 0.15341, 0.47457, 0.60066, 0.40880, + 0.20668, 0.41949, 0.97620, 0.94318, 0.71491, 0.56402, 0.23553, 0.94387, 0.78567, 0.06362, + 0.85252, 0.86262, 0.25190, 0.03274, 0.93216, 0.37971, 0.08797, 0.14596, 0.73871, 0.06574, + 0.67447, 0.28575, 0.43911, 0.92133, 0.12327, 0.87762, 0.71060, 0.07141, 0.55443, 0.53310, + 0.91529, 0.25121, 0.07593, 0.94490, 0.28656, 0.82174, 0.68887, 0.67337, 0.99291, 0.03316, + 0.02849, 0.33891, 0.25594, 0.90071, 0.01248, 0.67871, 0.65953, 0.65369, 0.97574, 0.31578, + 0.23678, 0.39220, 0.06706, 0.80943, 0.57694, 0.08220, 0.18151, 0.19969, 0.37096, 0.37858, + 0.70153, 0.46816, 0.76511, 0.02520, 0.39387, 0.25527, 0.39050, 0.60141, 0.30322, 0.46195, + 0.12025, 0.33616, 0.04174, 0.00196, 0.68886, 0.74445, 0.15869, 0.18994, 0.95195, 0.62874, + 0.82874, 0.53369, 0.34383, 0.50752, 0.97023, 0.22695, 0.62407, 0.25840, 0.71279, 0.28785, + 0.31611, 0.20391, 0.19702, 0.40760, 0.85158, 0.68369, 0.63760, 0.09879, 0.11924, 0.32920, + 0.53052, 0.15900, 0.21229, 0.84080, 0.33933, 0.93651, 0.42705, 0.06199, 0.50092, 0.47192, + 0.57152, 0.01818, 0.31404, 0.50173, 0.87725, 0.50530, 0.10717, 0.04035, 0.32901, 0.33538, + 0.04780, 0.40984, 0.78216, 0.91288, 0.11314, 0.25248, 0.23823, 0.74001, 0.48089, 0.55531, + 0.82486, 0.01058, 0.05409, 0.44357, 0.52641, 0.68188, 0.94629, 0.61627, 0.33037, 0.11961, + 0.57988, 0.19653, 0.91902, 0.59838, 0.52974, 0.28364, 0.45767, 0.65836, 0.63045, 0.76140, + 0.27918, 0.27256, 0.46035, 0.77418, 0.92918, 0.14095, 0.89645, 0.25146, 0.21172, 0.47910, + 0.95451, 0.34377, 0.29927, 0.79220, 0.97654, 0.67591, 0.44385, 0.38434, 0.44860, 0.28170, + 0.90712, 0.20337, 0.00292, 0.55046, 0.62255, 0.45127, 0.80896, 0.43965, 0.59145, 0.23801, + 0.33601, 0.30119, 0.89935, 0.40850, 0.98226, 0.75430, 0.68318, 0.65407, 0.68067, 0.32942, + 0.11756, 0.27626, 0.83879, 0.72174, 0.75430, 0.13702, 0.03402, 0.58781, 0.07393, 0.23067, + 0.92537, 0.29445, 0.43437, 0.47685, 0.54548, 0.66082, 0.23805, 0.60208, 0.94337, 0.21363, + 0.72637, 0.57181, 0.77679, 0.63931, 0.72860, 0.38901, 0.94920, 0.04535, 0.12863, 0.40550, + 0.90095, 0.21418, 0.13953, 0.99639, 0.02526, 0.70018, 0.21828, 0.20294, 0.20191, 0.30954, + 0.39490, 0.68955, 0.11506, 0.15748, 0.40252, 0.91680, 0.61547, 0.78443, 0.19693, 0.67630, + 0.56552, 0.58556, 0.53554, 0.53507, 0.09831, 0.21229, 0.83135, 0.26375, 0.89287, 0.97069, + 0.70615, 0.42041, 0.43117, 0.21291, 0.26086, 0.26978, 0.77340, 0.43833, 0.46179, 0.54418, + 0.67878, 0.42776, 0.61454, 0.55915, 0.36363, 0.31999, 0.42442, 0.86649, 0.62513, 0.02047 + }; class TestRunnable { diff --git a/dynare++/parser/cc/atom_assignings.cc b/dynare++/parser/cc/atom_assignings.cc index 2a5cb493a42d29fa43e5ba73b2c231edaeba6ec7..e49839b49d61c8e1af03b8de8ff68bbd93fd1af4 100644 --- a/dynare++/parser/cc/atom_assignings.cc +++ b/dynare++/parser/cc/atom_assignings.cc @@ -158,7 +158,7 @@ AtomAssignings::apply_subst(const AtomSubstitutions::Toldnamemap &mm) { // go through all old variables and see what are their derived new // variables - for (const auto & it : mm) + for (const auto &it : mm) { const string &oldname = it.first; const AtomSubstitutions::Tshiftnameset &sset = it.second; @@ -175,7 +175,7 @@ AtomAssignings::apply_subst(const AtomSubstitutions::Toldnamemap &mm) order.push_back(-1); // now go through all new names derived from the old name and // reference to the newly added formula - for (const auto & itt : sset) + for (const auto &itt : sset) { const string &newname = itt.first; left_names.insert(newname); diff --git a/dynare++/parser/cc/atom_substitutions.cc b/dynare++/parser/cc/atom_substitutions.cc index f0a8f8481fe1e9f2b4d3f229258a17dfb094a12e..840c240f6b9bb9ca376cf83af8dd12c74b625b6d 100644 --- a/dynare++/parser/cc/atom_substitutions.cc +++ b/dynare++/parser/cc/atom_substitutions.cc @@ -62,7 +62,7 @@ AtomSubstitutions::substitutions_finished(VarOrdering::ord_type ot) // add all new names derived from the old name auto it = old2new.find(oname); if (it != old2new.end()) - for (const auto & itt : it->second) + for (const auto &itt : it->second) na_ext.push_back(itt.first); } @@ -77,7 +77,7 @@ AtomSubstitutions::get_new4old(const string &oldname, int tshift) const if (it != old2new.end()) { const Tshiftnameset &sset = it->second; - for (const auto & itt : sset) + for (const auto &itt : sset) if (itt.second == -tshift) return itt.first; } @@ -88,12 +88,12 @@ void AtomSubstitutions::print() const { std::cout << u8"Atom Substitutions:\nOld ⇒ New:\n"; - for (const auto & it : old2new) + for (const auto &it : old2new) for (const auto &itt : it.second) std::cout << " " << it.first << u8" ⇒ [" << itt.first << ", " << itt.second << "]\n"; std::cout << u8"Old ⇐ New:\n"; - for (const auto & it : new2old) + for (const auto &it : new2old) std::cout << " [" << it.second.first << ", " << it.second.second << "] ⇐ " << it.first << '\n'; } diff --git a/dynare++/parser/cc/dynamic_atoms.cc b/dynare++/parser/cc/dynamic_atoms.cc index 4ec1707ea622fd3aa52326f8b6031fa5c3f17247..d1773fe1c1623163ca2e176acfdccd3066a40f88 100644 --- a/dynare++/parser/cc/dynamic_atoms.cc +++ b/dynare++/parser/cc/dynamic_atoms.cc @@ -55,7 +55,7 @@ Constants::import_constants(const Constants &c, OperationTree &otree, Tintintmap void Constants::setValues(EvalTree &et) const { - for (const auto & it : cmap) + for (const auto &it : cmap) et.set_nulary(it.first, it.second); } @@ -250,7 +250,7 @@ vector<int> DynamicAtoms::variables() const { vector<int> res; - for (const auto & var : vars) + for (const auto &var : vars) { const Tlagmap &lmap = var.second; for (auto itt : lmap) @@ -372,7 +372,7 @@ DynamicAtoms::print() const std::cout << "constants:\n"; Constants::print(); std::cout << "variables:\n"; - for (const auto & var : vars) + for (const auto &var : vars) { const Tlagmap &lmap = var.second; for (auto itt : lmap) @@ -501,7 +501,7 @@ VarOrdering::do_general(ord_type ordering) // make der_atoms and positions int off = 0; - for (auto & ord : ords) + for (auto &ord : ords) for (unsigned int j = 0; j < ord->size(); j++, off++) if ((*ord)[j] != -1) { diff --git a/dynare++/parser/cc/dynamic_atoms.hh b/dynare++/parser/cc/dynamic_atoms.hh index f963a099a20c0ba54e77cfaa33a1b9c94238df54..2efab37810eb4fa6a88303d5d83dab33ad76eb8d 100644 --- a/dynare++/parser/cc/dynamic_atoms.hh +++ b/dynare++/parser/cc/dynamic_atoms.hh @@ -347,7 +347,7 @@ namespace ogp public: /** This is an enum type for an ordering type implemented by * do_general. */ - enum ord_type {pbspbfbf, bfspbfpb}; + enum ord_type { pbspbfbf, bfspbfpb }; /** Construct the ordering of the variables given by the names * with their dynamic occurrences defined by the atoms. It * calls the virtual method do_ordering which can be diff --git a/dynare++/parser/cc/fine_atoms.hh b/dynare++/parser/cc/fine_atoms.hh index 010f5baf0c9b89d85253c2f584ef482a05572d32..61e4fd1d75e9000d90c3134cef267ebde1e01e8c 100644 --- a/dynare++/parser/cc/fine_atoms.hh +++ b/dynare++/parser/cc/fine_atoms.hh @@ -339,20 +339,20 @@ namespace ogp int get_pos_of_all(int t) const; /** Return the mapping from endogenous at time t to outer * ordering of endogenous. */ - const vector<int>&y2outer_endo() const; + const vector<int> &y2outer_endo() const; /** Return the mapping from the outer ordering of endogenous to endogenous * at time t. */ - const vector<int>&outer2y_endo() const; + const vector<int> &outer2y_endo() const; /** Return the mapping from exogenous at time t to outer * ordering of exogenous. */ - const vector<int>&y2outer_exo() const; + const vector<int> &y2outer_exo() const; /** Return the mapping from the outer ordering of exogenous to exogenous * at time t. */ - const vector<int>&outer2y_exo() const; + const vector<int> &outer2y_exo() const; /** Return the endo_atoms_map. */ - const vector<int>&get_endo_atoms_map() const; + const vector<int> &get_endo_atoms_map() const; /** Return the exo_atoms_map. */ - const vector<int>&get_exo_atoms_map() const; + const vector<int> &get_exo_atoms_map() const; /** Return an index in the outer ordering of a given * parameter. An exception is thrown if the name is not a * parameter. */ diff --git a/dynare++/parser/cc/formula_parser.cc b/dynare++/parser/cc/formula_parser.cc index 76eb2904013ee9bb7970ab9bb9039366fcc07389..1c37b3618ff5068a747dfa68e183d500ede53120 100644 --- a/dynare++/parser/cc/formula_parser.cc +++ b/dynare++/parser/cc/formula_parser.cc @@ -271,7 +271,7 @@ FormulaDerivatives::derivative(const FoldMultiIndex &mi) const void FormulaDerivatives::print(const OperationTree &otree) const { - for (const auto & it : ind2der) + for (const auto &it : ind2der) { std::cout << "derivative "; it.first.print(); diff --git a/dynare++/parser/cc/formula_parser.hh b/dynare++/parser/cc/formula_parser.hh index 44fbcbdfc58533566a8dd3bd7ef63ec56470e282..fde8eff81a8ff50c10090b647821b770b760d0fd 100644 --- a/dynare++/parser/cc/formula_parser.hh +++ b/dynare++/parser/cc/formula_parser.hh @@ -256,7 +256,7 @@ namespace ogp * different order). */ void differentiate(int max_order); /** Return i-th formula derivatives. */ - const FormulaDerivatives&derivatives(int i) const; + const FormulaDerivatives &derivatives(int i) const; /** This returns a maximum index of zero derivative formulas * including all nulary terms. This is a mimumum length of the diff --git a/dynare++/parser/cc/location.hh b/dynare++/parser/cc/location.hh index 8614c8188433f47e855418e9e5c982ef81892171..43a2839cef8332dae1e6877daa0481c967df9d0f 100644 --- a/dynare++/parser/cc/location.hh +++ b/dynare++/parser/cc/location.hh @@ -29,12 +29,12 @@ namespace ogp }; // set current off to the first off and add all lengths -#define YYLLOC_DEFAULT(Current, Rhs, N) \ - { \ - (Current).off = (Rhs)[1].off; \ - (Current).ll = 0; \ - for (int i = 1; i <= N; i++) \ - (Current).ll += (Rhs)[i].ll; \ +#define YYLLOC_DEFAULT(Current, Rhs, N) \ + { \ + (Current).off = (Rhs)[1].off; \ + (Current).ll = 0; \ + for (int i = 1; i <= N; i++) \ + (Current).ll += (Rhs)[i].ll; \ } #define SET_LLOC(prefix) (prefix ## lloc.off += prefix ## lloc.ll, prefix ## lloc.ll = prefix ## leng) diff --git a/dynare++/parser/cc/matrix_parser.cc b/dynare++/parser/cc/matrix_parser.cc index f0f29a8d6fa1ea27d6234cb78cb7876c69aa763f..46e64ff6e75f570a7b0321a8a2b41a77315cb88c 100644 --- a/dynare++/parser/cc/matrix_parser.cc +++ b/dynare++/parser/cc/matrix_parser.cc @@ -100,12 +100,12 @@ MatrixParser::end() const } MPIterator::MPIterator(const MatrixParser &mp) - : p(&mp), i(0), r(mp.find_first_non_empty_row()) + : p(&mp), i(0), r(mp.find_first_non_empty_row()) { } MPIterator::MPIterator(const MatrixParser &mp, const char *dummy) - : p(&mp), i(mp.data.size()), r(mp.row_lengths.size()) + : p(&mp), i(mp.data.size()), r(mp.row_lengths.size()) { } diff --git a/dynare++/parser/cc/static_fine_atoms.cc b/dynare++/parser/cc/static_fine_atoms.cc index b4b7487b2aeee302df9b8b5ef5969488f546268b..ea34f137350fd4d908983adf2f32720db7be1b01 100644 --- a/dynare++/parser/cc/static_fine_atoms.cc +++ b/dynare++/parser/cc/static_fine_atoms.cc @@ -96,7 +96,7 @@ StaticFineAtoms::parsing_finished() // go through all endo and exo insert tree indices, ignore names // whose tree index is -1 (those which are not referenced) - for (auto & endovar : endovars) + for (auto &endovar : endovars) { int t = index(endovar); if (t != -1) @@ -105,7 +105,7 @@ StaticFineAtoms::parsing_finished() der_atoms.push_back(t); } } - for (auto & exovar : exovars) + for (auto &exovar : exovars) { int t = index(exovar); if (t != -1) diff --git a/dynare++/parser/cc/tree.cc b/dynare++/parser/cc/tree.cc index 3ba9b8351de9c02538b8780d671e0a09ff1b1b11..bc8d7b7802ab056f9da2d799a3cfbf98d3448ca5 100644 --- a/dynare++/parser/cc/tree.cc +++ b/dynare++/parser/cc/tree.cc @@ -287,7 +287,7 @@ OperationTree::add_derivative(int t, int v) int tmp1 = add_derivative(terms[t].getOp1(), v); int tmp2 = add_derivative(terms[t].getOp2(), v); int res1 = add_binary(code_t::TIMES, terms[t].getOp1(), tmp2); - int res2 = add_binary(code_t::TIMES, tmp1, terms[t].getOp2()); + int res2 = add_binary(code_t::TIMES, tmp1, terms[t].getOp2()); res = add_binary(code_t::PLUS, res1, res2); break; } @@ -477,7 +477,7 @@ OperationTree::select_terms_inv(int t, const opselector &sel, unordered_set<int> void OperationTree::forget_derivative_maps() { - for (auto & derivative : derivatives) + for (auto &derivative : derivatives) derivative.clear(); } diff --git a/dynare++/parser/cc/tree.hh b/dynare++/parser/cc/tree.hh index 5e14c8bf2ecbba50ab6a0320a933fdeb3ebae48c..b5041cca53195d7cee4047ac1330477007408fde 100644 --- a/dynare++/parser/cc/tree.hh +++ b/dynare++/parser/cc/tree.hh @@ -42,8 +42,8 @@ namespace ogp * codes, he should update the code of #OperationTree::add_unary, * #OperationTree::add_binary, and of course * #OperationTree::add_derivative. */ - enum class code_t {NONE, UMINUS, LOG, EXP, SIN, COS, TAN, SQRT, ERF, - ERFC, PLUS, MINUS, TIMES, DIVIDE, POWER}; + enum class code_t { NONE, UMINUS, LOG, EXP, SIN, COS, TAN, SQRT, ERF, + ERFC, PLUS, MINUS, TIMES, DIVIDE, POWER }; /** Class representing a nulary, unary, or binary operation. */ class Operation @@ -64,7 +64,7 @@ namespace ogp } /** Constructs a unary operation. */ Operation(code_t cd, int oper1) - : code(cd), op1(oper1) + : code(cd), op1(oper1) { } /** Constructs a nulary operation. */ @@ -218,7 +218,7 @@ namespace ogp * 2/pi. These will be always first four terms having indices * zero, one and two, three. If adding anything to this * enumeration, make sure ‘num_constants’ remains the last one.*/ - enum {zero, one, nan, two_over_pi, num_constants}; + enum { zero, one, nan, two_over_pi, num_constants }; /** The unique constructor which initializes the object to * contain only zero, one and nan and two_over_pi.*/ diff --git a/dynare++/src/dynare3.hh b/dynare++/src/dynare3.hh index 4990a91f33e7258815e5f23442ba5107dd4d92b8..f31946f1162684cc127694416b85784bb4e056e4 100644 --- a/dynare++/src/dynare3.hh +++ b/dynare++/src/dynare3.hh @@ -129,7 +129,7 @@ public: { return std::make_unique<Dynare>(*this); } - + ~Dynare() override = default; int nstat() const override diff --git a/dynare++/src/dynare_atoms.cc b/dynare++/src/dynare_atoms.cc index 0ca99840f3dfac47cc162492ebd6367ba58e6cb2..3360fc4e3a98442a42cf78dd814f65c73abc710b 100644 --- a/dynare++/src/dynare_atoms.cc +++ b/dynare++/src/dynare_atoms.cc @@ -186,7 +186,7 @@ DynareAtomValues::setValues(ogp::EvalTree &et) const for (auto it : lmap) { int ll = it.first; - if (ll == 0) // this is always true because of checks + if (ll == 0) // this is always true because of checks { int t = it.second; int i = atoms.outer2y_exo()[outer_i]; diff --git a/dynare++/src/dynare_atoms.hh b/dynare++/src/dynare_atoms.hh index c9639be182db47c3355d6a9fa00c81e355955df1..54a34c4269f5c53f5a4f0eb9aeaae8d84b0fba96 100644 --- a/dynare++/src/dynare_atoms.hh +++ b/dynare++/src/dynare_atoms.hh @@ -64,7 +64,7 @@ namespace ogdyn class DynareDynamicAtoms : public ogp::SAtoms, public ogp::NularyStringConvertor { public: - enum class atype {endovar, exovar, param}; + enum class atype { endovar, exovar, param }; protected: using Tatypemap = map<string, atype>; /* The map assigining a type to each name. */ diff --git a/dynare++/src/dynare_exception.hh b/dynare++/src/dynare_exception.hh index 99eff6ad929c985f224e2cae395a8455cc35d522..1112a37c6094833f8ecc4a4ed9baa15519cd229a 100644 --- a/dynare++/src/dynare_exception.hh +++ b/dynare++/src/dynare_exception.hh @@ -29,8 +29,8 @@ class DynareException std::string mes; public: DynareException(const std::string &m, const std::string &fname, int line, int col) - : mes{"Parse error at " + fname + ", line " + std::to_string(line) + ", column " + - std::to_string(col) + ": " + m} + : mes{"Parse error at " + fname + ", line " + std::to_string(line) + ", column " + + std::to_string(col) + ": " + m} { } DynareException(const std::string &fname, int line, const std::string &m) diff --git a/dynare++/src/dynare_model.cc b/dynare++/src/dynare_model.cc index d7d8abb6a2ce82c05457944e248fbdac45d898cb..683e7f8a4992027d98a90db97d1a62d9c799e326 100644 --- a/dynare++/src/dynare_model.cc +++ b/dynare++/src/dynare_model.cc @@ -45,7 +45,7 @@ ParsedMatrix::ParsedMatrix(const ogp::MatrixParser &mp) } DynareModel::DynareModel() - : atoms(), eqs(atoms) + : atoms(), eqs(atoms) { } diff --git a/dynare++/src/dynare_model.hh b/dynare++/src/dynare_model.hh index 18c428df009a69f66ef5c2b0fbe414bae79a93f0..6c9a2f231595970b0771acd28b91d8dcc59912b0 100644 --- a/dynare++/src/dynare_model.hh +++ b/dynare++/src/dynare_model.hh @@ -404,8 +404,8 @@ namespace ogdyn in the subclass. */ void write_der0(std::ostream &os); /* This writes the evaluation of the first order derivative of the system. - It calls pure virtual methods for writing a preamble, assignment, and - assignemnt of the resulting objects. */ + It calls pure virtual methods for writing a preamble, assignment, and + assignemnt of the resulting objects. */ void write_der1(std::ostream &os); protected: virtual void write_der0_preamble(std::ostream &os) const = 0; diff --git a/dynare++/src/dynare_params.cc b/dynare++/src/dynare_params.cc index a2a989a69539e744df3c3c3c276bdb8b720f34be..81b8064a425b868f6ebd4f951a0d2ce1c0638a7b 100644 --- a/dynare++/src/dynare_params.cc +++ b/dynare++/src/dynare_params.cc @@ -51,39 +51,40 @@ DynareParams::DynareParams(int argc, char **argv) modname = argv[argc-1]; argc--; - struct option const opts [] = { - {"periods", required_argument, nullptr, static_cast<int>(opt::per)}, - {"per", required_argument, nullptr, static_cast<int>(opt::per)}, - {"burn", required_argument, nullptr, static_cast<int>(opt::burn)}, - {"simulations", required_argument, nullptr, static_cast<int>(opt::sim)}, - {"sim", required_argument, nullptr, static_cast<int>(opt::sim)}, - {"rtperiods", required_argument, nullptr, static_cast<int>(opt::rtper)}, - {"rtper", required_argument, nullptr, static_cast<int>(opt::rtper)}, - {"rtsimulations", required_argument, nullptr, static_cast<int>(opt::rtsim)}, - {"rtsim", required_argument, nullptr, static_cast<int>(opt::rtsim)}, - {"condperiods", required_argument, nullptr, static_cast<int>(opt::condper)}, - {"condper", required_argument, nullptr, static_cast<int>(opt::condper)}, - {"condsimulations", required_argument, nullptr, static_cast<int>(opt::condsim)}, - {"condsim", required_argument, nullptr, static_cast<int>(opt::condsim)}, - {"prefix", required_argument, nullptr, static_cast<int>(opt::prefix)}, - {"threads", required_argument, nullptr, static_cast<int>(opt::threads)}, - {"steps", required_argument, nullptr, static_cast<int>(opt::steps)}, - {"seed", required_argument, nullptr, static_cast<int>(opt::seed)}, - {"order", required_argument, nullptr, static_cast<int>(opt::order)}, - {"ss-tol", required_argument, nullptr, static_cast<int>(opt::ss_tol)}, - {"check", required_argument, nullptr, static_cast<int>(opt::check)}, - {"check-scale", required_argument, nullptr, static_cast<int>(opt::check_scale)}, - {"check-evals", required_argument, nullptr, static_cast<int>(opt::check_evals)}, - {"check-num", required_argument, nullptr, static_cast<int>(opt::check_num)}, - {"qz-criterium", required_argument, nullptr, static_cast<int>(opt::qz_criterium)}, - {"no-irfs", no_argument, nullptr, static_cast<int>(opt::noirfs)}, - {"irfs", no_argument, nullptr, static_cast<int>(opt::irfs)}, - {"centralize", no_argument, nullptr, static_cast<int>(opt::centralize)}, - {"no-centralize", no_argument, nullptr, static_cast<int>(opt::no_centralize)}, - {"help", no_argument, nullptr, static_cast<int>(opt::help)}, - {"version", no_argument, nullptr, static_cast<int>(opt::version)}, - {nullptr, 0, nullptr, 0} - }; + struct option const opts[] = + { + {"periods", required_argument, nullptr, static_cast<int>(opt::per)}, + {"per", required_argument, nullptr, static_cast<int>(opt::per)}, + {"burn", required_argument, nullptr, static_cast<int>(opt::burn)}, + {"simulations", required_argument, nullptr, static_cast<int>(opt::sim)}, + {"sim", required_argument, nullptr, static_cast<int>(opt::sim)}, + {"rtperiods", required_argument, nullptr, static_cast<int>(opt::rtper)}, + {"rtper", required_argument, nullptr, static_cast<int>(opt::rtper)}, + {"rtsimulations", required_argument, nullptr, static_cast<int>(opt::rtsim)}, + {"rtsim", required_argument, nullptr, static_cast<int>(opt::rtsim)}, + {"condperiods", required_argument, nullptr, static_cast<int>(opt::condper)}, + {"condper", required_argument, nullptr, static_cast<int>(opt::condper)}, + {"condsimulations", required_argument, nullptr, static_cast<int>(opt::condsim)}, + {"condsim", required_argument, nullptr, static_cast<int>(opt::condsim)}, + {"prefix", required_argument, nullptr, static_cast<int>(opt::prefix)}, + {"threads", required_argument, nullptr, static_cast<int>(opt::threads)}, + {"steps", required_argument, nullptr, static_cast<int>(opt::steps)}, + {"seed", required_argument, nullptr, static_cast<int>(opt::seed)}, + {"order", required_argument, nullptr, static_cast<int>(opt::order)}, + {"ss-tol", required_argument, nullptr, static_cast<int>(opt::ss_tol)}, + {"check", required_argument, nullptr, static_cast<int>(opt::check)}, + {"check-scale", required_argument, nullptr, static_cast<int>(opt::check_scale)}, + {"check-evals", required_argument, nullptr, static_cast<int>(opt::check_evals)}, + {"check-num", required_argument, nullptr, static_cast<int>(opt::check_num)}, + {"qz-criterium", required_argument, nullptr, static_cast<int>(opt::qz_criterium)}, + {"no-irfs", no_argument, nullptr, static_cast<int>(opt::noirfs)}, + {"irfs", no_argument, nullptr, static_cast<int>(opt::irfs)}, + {"centralize", no_argument, nullptr, static_cast<int>(opt::centralize)}, + {"no-centralize", no_argument, nullptr, static_cast<int>(opt::no_centralize)}, + {"help", no_argument, nullptr, static_cast<int>(opt::help)}, + {"version", no_argument, nullptr, static_cast<int>(opt::version)}, + {nullptr, 0, nullptr, 0} + }; int ret; int index; diff --git a/dynare++/src/dynare_params.hh b/dynare++/src/dynare_params.hh index 79e8a1ea0b7d0f99bb0c81bcbc38fdf4874a5c1d..3139bf8e9c6f2d924823bf697a52656c2040ffdb 100644 --- a/dynare++/src/dynare_params.hh +++ b/dynare++/src/dynare_params.hh @@ -89,11 +89,11 @@ struct DynareParams return 10*check_num; } private: - enum class opt {per, burn, sim, rtper, rtsim, condper, condsim, - prefix, threads, - steps, seed, order, ss_tol, check, - check_evals, check_scale, check_num, noirfs, irfs, - help, version, centralize, no_centralize, qz_criterium}; + enum class opt { per, burn, sim, rtper, rtsim, condper, condsim, + prefix, threads, + steps, seed, order, ss_tol, check, + check_evals, check_scale, check_num, noirfs, irfs, + help, version, centralize, no_centralize, qz_criterium }; void processCheckFlags(const std::string &flags); /* This gathers strings from argv[optind] and on not starting with '-' to the irf_list. It stops one item before the end, since this is the model diff --git a/dynare++/src/forw_subst_builder.cc b/dynare++/src/forw_subst_builder.cc index e4e4f4cf25677db75dac1a98aed9c67bb1a1a043..fc713e1f4aba5cc9fc703c5cc656a2df41d0ee1b 100644 --- a/dynare++/src/forw_subst_builder.cc +++ b/dynare++/src/forw_subst_builder.cc @@ -70,7 +70,7 @@ ForwSubstBuilder::substitute_for_term(int t, int i, int j) // first make lagsubst be substitution setting f(x(+4)) to f(x(+1)) // this is lag = -3 (1-mlead) map<int, int> lagsubst; - unordered_set<int> nult = model.eqs.nulary_of_term(t);// make copy of nult! + unordered_set<int> nult = model.eqs.nulary_of_term(t); // make copy of nult! model.variable_shift_map(nult, 1-mlead, lagsubst); int lagt = model.eqs.add_substitution(t, lagsubst); diff --git a/dynare++/src/planner_builder.cc b/dynare++/src/planner_builder.cc index 90a15516ba2015fa02f000b7b31550408aa4f177..0fb3202e0dc14d049d0e53f2f46e6ca1fa9ad572 100644 --- a/dynare++/src/planner_builder.cc +++ b/dynare++/src/planner_builder.cc @@ -87,7 +87,6 @@ PlannerBuilder::PlannerBuilder(const PlannerBuilder &pb, ogdyn::DynareModel &m) diff_b_static(pb.diff_b_static), diff_f_static(pb.diff_f_static), aux_map(), static_aux_map() - { fill_yset(m.atoms.get_name_storage(), pb.yset); fill_aux_map(m.atoms.get_name_storage(), pb.aux_map, pb.static_aux_map); @@ -244,7 +243,7 @@ PlannerBuilder::make_static_version() for (int yi = 0; yi < diff_b.nrows(); yi++) diff_b_static(yi, ll-minlag) = static_tree.add_substitution(diff_b(yi, ll-minlag), - tmap, model.eqs.getTree()); + tmap, model.eqs.getTree()); // go through diff_f and fill diff_f_static for (int ll = minlag; ll <= maxlead; ll++) @@ -384,7 +383,7 @@ MultInitSS::MultInitSS(const PlannerBuilder &pb, const Vector &pvals, Vector &yy if (it != old2new.end()) { const ogp::AtomSubstitutions::Tshiftnameset &sset = it->second; - for (const auto & itt : sset) + for (const auto &itt : sset) { const std::string &newname = itt.first; int iouter = builder.model.atoms.name2outer_endo(newname); diff --git a/dynare++/sylv/cc/BlockDiagonal.cc b/dynare++/sylv/cc/BlockDiagonal.cc index eb8d4d1195e8200dabe221ca5e98b3d168edbe0a..aec1a6a2b67447394d54c51874a43dcdcfe643fa 100644 --- a/dynare++/sylv/cc/BlockDiagonal.cc +++ b/dynare++/sylv/cc/BlockDiagonal.cc @@ -65,7 +65,7 @@ BlockDiagonal::setZerosToRU(diag_iter edge) of the right-most non-zero element of i-th row from the left, and col_len[j] is distance of top-most non-zero element of j-th column to the top. (First element has distance 1). - */ +*/ void BlockDiagonal::setZeroBlockEdge(diag_iter edge) { diff --git a/dynare++/sylv/cc/GeneralMatrix.hh b/dynare++/sylv/cc/GeneralMatrix.hh index 383cf0cda14ef24ff9ba6c1308403a537a0b1098..e49e221c38f8864ba0edaba7685d1acf766f3f65 100644 --- a/dynare++/sylv/cc/GeneralMatrix.hh +++ b/dynare++/sylv/cc/GeneralMatrix.hh @@ -42,7 +42,9 @@ class TransposedMatrix private: T &orig; public: - TransposedMatrix(T &orig_arg) : orig{orig_arg} {}; + TransposedMatrix(T &orig_arg) : orig{orig_arg} + { + }; }; // Syntactic sugar for representing a transposed matrix diff --git a/dynare++/sylv/cc/IterativeSylvester.cc b/dynare++/sylv/cc/IterativeSylvester.cc index 5c81d60fafa760b9e0de49de05c65d4783a6cc0d..bca1d058f06844982c8336384077b174e8bcc289 100644 --- a/dynare++/sylv/cc/IterativeSylvester.cc +++ b/dynare++/sylv/cc/IterativeSylvester.cc @@ -31,7 +31,7 @@ IterativeSylvester::solve(SylvParams &pars, KronVector &x) const auto kpow = matrixK->clone(); auto fpow = matrixF->clone(); - while (steps < max_steps &&norm > max_norm) + while (steps < max_steps && norm > max_norm) { kpow->multRight(SqSylvMatrix(*kpow)); // be careful to make copy fpow->multRight(SqSylvMatrix(*fpow)); // also here diff --git a/dynare++/sylv/cc/QuasiTriangular.cc b/dynare++/sylv/cc/QuasiTriangular.cc index 5814273526524eebaae5903fbe5170ab6fc0abb5..cdf3ea1eb6fa6859ce5849476a4223d011762970 100644 --- a/dynare++/sylv/cc/QuasiTriangular.cc +++ b/dynare++/sylv/cc/QuasiTriangular.cc @@ -148,7 +148,7 @@ void Diagonal::changeBase(double *p) { int d_size = getSize(); - for (auto & it : *this) + for (auto &it : *this) { const DiagonalBlock &b = it; int jbar = b.getIndex(); @@ -179,7 +179,7 @@ Diagonal::getEigenValues(Vector &eig) const << ", should be=" << 2*d_size << '.' << std::endl; throw SYLV_MES_EXCEPTION(mes.str()); } - for (const auto & b : *this) + for (const auto &b : *this) { int ind = b.getIndex(); eig[2*ind] = *(b.getAlpha()); @@ -303,7 +303,7 @@ Diagonal::print() const auto ff = std::cout.flags(); std::cout << "Num real: " << getNumReal() << ", num complex: " << getNumComplex() << std::endl << std::fixed; - for (const auto & it : *this) + for (const auto &it : *this) if (it.isReal()) std::cout << "real: jbar=" << it.getIndex() << ", alpha=" << *(it.getAlpha()) << std::endl; else diff --git a/dynare++/sylv/cc/QuasiTriangular.hh b/dynare++/sylv/cc/QuasiTriangular.hh index b7e52787daadbf7a7bb32ad490cd4e77dd5c2002..ed1fab7e489f86ba9446d67de7cf80d49ce41e35 100644 --- a/dynare++/sylv/cc/QuasiTriangular.hh +++ b/dynare++/sylv/cc/QuasiTriangular.hh @@ -222,7 +222,7 @@ private: static bool isZero(double p); }; -template <class _TRef, class _TPtr> +template<class _TRef, class _TPtr> struct _matrix_iter { using _Self = _matrix_iter<_TRef, _TPtr>; @@ -260,7 +260,7 @@ public: virtual _Self &operator++() = 0; }; -template <class _TRef, class _TPtr> +template<class _TRef, class _TPtr> class _column_iter : public _matrix_iter<_TRef, _TPtr> { using _Tparent = _matrix_iter<_TRef, _TPtr>; @@ -293,7 +293,7 @@ public: } }; -template <class _TRef, class _TPtr> +template<class _TRef, class _TPtr> class _row_iter : public _matrix_iter<_TRef, _TPtr> { using _Tparent = _matrix_iter<_TRef, _TPtr>; @@ -358,7 +358,7 @@ public: explicit QuasiTriangular(const SchurDecomp &decomp); explicit QuasiTriangular(const SchurDecompZero &decomp); QuasiTriangular(const QuasiTriangular &t); - + ~QuasiTriangular() override = default; const Diagonal & getDiagonal() const diff --git a/dynare++/sylv/cc/SchurDecomp.cc b/dynare++/sylv/cc/SchurDecomp.cc index b4b1eb6cf0d1eac35aab62c06b25de4b37e2a2b6..01c1460114ab05fe85f6b61f497b1dcd1844ad51 100644 --- a/dynare++/sylv/cc/SchurDecomp.cc +++ b/dynare++/sylv/cc/SchurDecomp.cc @@ -31,10 +31,10 @@ SchurDecomp::SchurDecomp(const SqSylvMatrix &m) SqSylvMatrix auxt(m); lapack_int lda = auxt.getLD(), ldvs = q.getLD(); lapack_int sdim; - auto wr = std::make_unique<double []>(rows); - auto wi = std::make_unique<double []>(rows); + auto wr = std::make_unique<double[]>(rows); + auto wi = std::make_unique<double[]>(rows); lapack_int lwork = 6*rows; - auto work = std::make_unique<double []>(lwork); + auto work = std::make_unique<double[]>(lwork); lapack_int info; dgees("V", "N", nullptr, &rows, auxt.base(), &lda, &sdim, wr.get(), wi.get(), q.base(), &ldvs, diff --git a/dynare++/sylv/cc/SchurDecompEig.cc b/dynare++/sylv/cc/SchurDecompEig.cc index edc78e7253eb020db69415ea3d583293b6d9a7b5..babab598d95dbf729acfcaca7f4436324f12d10d 100644 --- a/dynare++/sylv/cc/SchurDecompEig.cc +++ b/dynare++/sylv/cc/SchurDecompEig.cc @@ -30,7 +30,7 @@ neighbour is bubbled also in front. The method returns a new position ‘to’, where the original block pointed by ‘to’ happens to appear at the end. ‘from’ must be greater than ‘to’. - */ +*/ SchurDecompEig::diag_iter SchurDecompEig::bubbleEigen(diag_iter from, diag_iter to) { @@ -65,7 +65,7 @@ SchurDecompEig::bubbleEigen(diag_iter from, diag_iter to) resolve eigenvalues from ‘itadd’ to ‘it’, before the ‘it’ can be resolved. The success is signaled by returned true. - */ +*/ bool SchurDecompEig::tryToSwap(diag_iter &it, diag_iter &itadd) { diff --git a/dynare++/sylv/cc/SimilarityDecomp.cc b/dynare++/sylv/cc/SimilarityDecomp.cc index 64690aa4d3e6f54c586053840609c3a79af13a82..773c5623bbeb6de2557a6b119b694d4c541de2bd 100644 --- a/dynare++/sylv/cc/SimilarityDecomp.cc +++ b/dynare++/sylv/cc/SimilarityDecomp.cc @@ -52,7 +52,7 @@ SimilarityDecomp::getXDim(diag_iter start, diag_iter end, /* Find solution of X for diagonal block given by start(incl.) and end(excl.). If the solution cannot be found, or it is greater than norm, X is not changed and flase is returned. - */ +*/ bool SimilarityDecomp::solveX(diag_iter start, diag_iter end, GeneralMatrix &X, double norm) const diff --git a/dynare++/sylv/cc/SylvParams.cc b/dynare++/sylv/cc/SylvParams.cc index f3e70d7b3d214eac48ecdb8c8290d4f20fc3ecfc..cae41ad404e2646f6a13e9531f382298170556c2 100644 --- a/dynare++/sylv/cc/SylvParams.cc +++ b/dynare++/sylv/cc/SylvParams.cc @@ -133,11 +133,11 @@ mxArray * SylvParams::IntParamItem::createMatlabArray() const { mxArray *res = mxCreateNumericMatrix(1, 1, mxINT32_CLASS, mxREAL); -#if MX_HAS_INTERLEAVED_COMPLEX +# if MX_HAS_INTERLEAVED_COMPLEX *mxGetInt32s(res) = value; -#else +# else *static_cast<int *>(mxGetData(res)) = value; -#endif +# endif return res; } diff --git a/dynare++/sylv/cc/SylvParams.hh b/dynare++/sylv/cc/SylvParams.hh index 29b141c067c228077ea8034eb986a66a7bafb237..a068ecacd7ce3c9b1e95c69e26e260d21e1decca 100644 --- a/dynare++/sylv/cc/SylvParams.hh +++ b/dynare++/sylv/cc/SylvParams.hh @@ -28,9 +28,9 @@ # include <dynmex.h> #endif -enum class status {def, changed, undef}; +enum class status { def, changed, undef }; -template <class _Type> +template<class _Type> struct ParamItem { protected: @@ -81,7 +81,7 @@ public: class SylvParams { public: - enum class solve_method {iter, recurse}; + enum class solve_method { iter, recurse }; protected: class DoubleParamItem : public ParamItem<double> diff --git a/dynare++/sylv/cc/TriangularSylvester.hh b/dynare++/sylv/cc/TriangularSylvester.hh index 8abe68ac377f0aa6c8c8a9126d12c621b8903abf..ecfa87d076fe9fd63ed2ff0b604346ee91563926 100644 --- a/dynare++/sylv/cc/TriangularSylvester.hh +++ b/dynare++/sylv/cc/TriangularSylvester.hh @@ -37,7 +37,7 @@ public: TriangularSylvester(const QuasiTriangular &k, const QuasiTriangular &f); TriangularSylvester(const SchurDecompZero &kdecomp, const SchurDecomp &fdecomp); TriangularSylvester(const SchurDecompZero &kdecomp, const SimilarityDecomp &fdecomp); - + ~TriangularSylvester() override = default; void print() const; void solve(SylvParams &pars, KronVector &d) const override; diff --git a/dynare++/sylv/testing/tests.cc b/dynare++/sylv/testing/tests.cc index eaf80833daf68a7b8d38f457e368225aa26f496c..1bcfa70dcfa3e4bb02f482569ac9024e1536c346 100644 --- a/dynare++/sylv/testing/tests.cc +++ b/dynare++/sylv/testing/tests.cc @@ -398,7 +398,7 @@ TestRunnable::gen_sylv(const std::string &aname, const std::string &bname, const if (m != mmc.row() || m != mmc.col() || n != mma.row() || n != mma.col() - || n != mmb.row() || n < mmb.col() + || n != mmb.row() || n < mmb.col() || n != mmd.row() || power(m, order) != mmd.col()) { std::cout << " Incompatible sizes for gen_sylv.\n"; @@ -447,10 +447,10 @@ TestRunnable::eig_bubble(const std::string &aname, int from, int to) double normInf = check.getNormInf(); double onorm1 = orig.getNorm1(); double onormInf = orig.getNormInf(); - std:: cout << "\tabs. error1 = " << norm1 << std::endl - << u8"\tabs. error∞ = " << normInf << std::endl - << "\trel. error1 = " << norm1/onorm1 << std::endl - << u8"\trel. error∞ = " << normInf/onormInf << std::endl; + std::cout << "\tabs. error1 = " << norm1 << std::endl + << u8"\tabs. error∞ = " << normInf << std::endl + << "\trel. error1 = " << norm1/onorm1 << std::endl + << u8"\trel. error∞ = " << normInf/onormInf << std::endl; return (norm1 < eps_norm*onorm1 && normInf < eps_norm*onormInf); } diff --git a/dynare++/tl/cc/fine_container.hh b/dynare++/tl/cc/fine_container.hh index 70b6843f0ff1a96d4d08f87c8653e35157236b87..38bec75d759cb0fd3f5544551ace5d3206539332 100644 --- a/dynare++/tl/cc/fine_container.hh +++ b/dynare++/tl/cc/fine_container.hh @@ -90,7 +90,7 @@ public: method, which returns a type for a given stack as the type of the corresponding (old) stack of the former stack container. */ -template <class _Ttype> +template<class _Ttype> class FineContainer : public SizeRefinement, public StackContainer<_Ttype> { protected: @@ -117,8 +117,8 @@ public: FineContainer(const _Stype &sc, int max) : SizeRefinement(sc.getStackSizes(), sc.numConts(), max), StackContainer<_Ttype>(numRefinements(), getNC()), - ref_conts(getNC()), - stack_cont(sc) + ref_conts(getNC()), + stack_cont(sc) { for (int i = 0; i < numRefinements(); i++) _Stype::stack_sizes[i] = getRefSize(i); diff --git a/dynare++/tl/cc/fs_tensor.cc b/dynare++/tl/cc/fs_tensor.cc index 7d77dcebcaab9839d24399d3f18a78da0e486dc8..9330044a0d74b705d72f08c00b2941e4a405223b 100644 --- a/dynare++/tl/cc/fs_tensor.cc +++ b/dynare++/tl/cc/fs_tensor.cc @@ -59,7 +59,7 @@ FFSTensor::FFSTensor(const FFSTensor &t, const ConstVector &x) symmetry. Let n be a number of variables and d the ⎛n+d-1⎞ dimension dim. Then the number of indices is ⎝ d ⎠. - */ +*/ int FFSTensor::calcMaxOffset(int nvar, int d) @@ -79,7 +79,7 @@ FFSTensor::FFSTensor(const FSSparseTensor &t) nv(t.nvar()) { zeros(); - for (const auto & it : t.getMap()) + for (const auto &it : t.getMap()) { index ind(*this, it.first); get(it.second.first, *ind) = it.second.second; diff --git a/dynare++/tl/cc/gs_tensor.hh b/dynare++/tl/cc/gs_tensor.hh index 19168d2c26941cdc8bd8fafaaea11ba466797143..a16fe1f1b8a6ac940cc43ba9b41cff8bf06173f6 100644 --- a/dynare++/tl/cc/gs_tensor.hh +++ b/dynare++/tl/cc/gs_tensor.hh @@ -215,7 +215,7 @@ public: UGSTensor(UGSTensor &&) = default; UGSTensor(int first_row, int num, UGSTensor &t) - : UTensor(first_row, num, t), tdims(t.tdims) + : UTensor(first_row, num, t), tdims(t.tdims) { } diff --git a/dynare++/tl/cc/int_sequence.cc b/dynare++/tl/cc/int_sequence.cc index 8cba193ad23727b8c208a44e8d48cb9abd8193a0..f5a50a77587165fa6b269f81f34cd67981bffc2b 100644 --- a/dynare++/tl/cc/int_sequence.cc +++ b/dynare++/tl/cc/int_sequence.cc @@ -284,7 +284,7 @@ IntSequence::print() const we want to compute the number of permutations of the word ‘yyyyuuvvv’. ⎛ 9 ⎞ This is equal to the multinomial coefficient ⎝4,2,3⎠. - */ +*/ int IntSequence::noverseq() { diff --git a/dynare++/tl/cc/normal_moments.cc b/dynare++/tl/cc/normal_moments.cc index e0931cb2b51273664dec21975398a3b99499b043..ff8468b731538691a4fa89fdd486ce52dac28129 100644 --- a/dynare++/tl/cc/normal_moments.cc +++ b/dynare++/tl/cc/normal_moments.cc @@ -37,7 +37,7 @@ UNormalMoments::UNormalMoments(int maxdim, const TwoDMatrix &v) equal to 2n. See the header file for proof and details. Here we sequentially construct the Kronecker power ⊗ⁿv and apply Fₙ. - */ +*/ void UNormalMoments::generateMoments(int maxdim, const TwoDMatrix &v) { diff --git a/dynare++/tl/cc/permutation.hh b/dynare++/tl/cc/permutation.hh index 32e1045b005423a1da31a240d18ec110ff729621..1986c0c33bdecaa8faeb3a4c85e79bf5accc34b8 100644 --- a/dynare++/tl/cc/permutation.hh +++ b/dynare++/tl/cc/permutation.hh @@ -43,7 +43,7 @@ Also, we need PermutationSet class which contains all permutations of an n-element set, and a bundle of permutations PermutationBundle which contains all permutation sets up to a given number. - */ +*/ #ifndef PERMUTATION_H #define PERMUTATION_H @@ -63,7 +63,7 @@ indices which yield identity. Also we have a constructor calculating map, which corresponds to permutation in sort. This is, we want (sorted s)∘m = s. - */ +*/ class Permutation { diff --git a/dynare++/tl/cc/ps_tensor.hh b/dynare++/tl/cc/ps_tensor.hh index 3acfd236e6fd1beb5c13d7acc0cf3f9847e257e9..a5b3f0654ab6fd55cef70e7f6121fa18221e3b16 100644 --- a/dynare++/tl/cc/ps_tensor.hh +++ b/dynare++/tl/cc/ps_tensor.hh @@ -86,7 +86,8 @@ class PerTensorDimens : public TensorDimens { private: - static IntSequence sortIntSequence(IntSequence s) + static IntSequence + sortIntSequence(IntSequence s) { s.sort(); return s; @@ -221,7 +222,7 @@ public: void addTo(FGSTensor &out) const; void addTo(UGSTensor &out) const; - enum class fill_method {first, second}; + enum class fill_method { first, second }; static fill_method decideFillMethod(const FSSparseTensor &t); private: int tailIdentitySize() const; diff --git a/dynare++/tl/cc/pyramid_prod.cc b/dynare++/tl/cc/pyramid_prod.cc index 0bfb156ad553401fe066c2a397fcdf2c1deae680..8e2a4cfefed20f37029921b81a240ff845a3dde4 100644 --- a/dynare++/tl/cc/pyramid_prod.cc +++ b/dynare++/tl/cc/pyramid_prod.cc @@ -43,7 +43,7 @@ USubTensor::USubTensor(const TensorDimens &bdims, "Tensor has not full symmetry in USubTensor()"); const EquivalenceSet &eset = TLStatic::getEquiv(bdims.dimen()); zeros(); - for (const auto & it : eset) + for (const auto &it : eset) { if (it.numClasses() == hdims.dimen()) { diff --git a/dynare++/tl/cc/stack_container.cc b/dynare++/tl/cc/stack_container.cc index 291d3af7df006f419bc72f87b580d1a5e2864794..71144fe88ff6a9a14ac21c41dd4c6b7a5ef115c4 100644 --- a/dynare++/tl/cc/stack_container.cc +++ b/dynare++/tl/cc/stack_container.cc @@ -119,7 +119,7 @@ WorkerFoldMAASparse1::operator()(std::mutex &mut) const Permutation &per = pset.get(iper); IntSequence percoor(coor.size()); per.apply(coor, percoor); - for (const auto & it : eset) + for (const auto &it : eset) { if (it.numClasses() == t.dimen()) { @@ -163,7 +163,7 @@ FoldedStackContainer::multAndAddSparse2(const FSSparseTensor &t, sthread::detach_thread_group gr; FFSTensor dummy_f(0, numStacks(), t.dimen()); for (Tensor::index fi = dummy_f.begin(); fi != dummy_f.end(); ++fi) - gr.insert(std::make_unique<WorkerFoldMAASparse2>(*this, t, out, fi.getCoor())); + gr.insert(std::make_unique<WorkerFoldMAASparse2>(*this, t, out, fi.getCoor())); gr.run(); } @@ -231,7 +231,7 @@ FoldedStackContainer::multAndAddSparse3(const FSSparseTensor &t, Vector outcol{out.getCol(*run)}; FRSingleTensor sumcol(t.nvar(), t.dimen()); sumcol.zeros(); - for (const auto & it : eset) + for (const auto &it : eset) if (it.numClasses() == t.dimen()) { StackProduct<FGSTensor> sp(*this, it, out.getSym()); @@ -485,7 +485,7 @@ WorkerUnfoldMAASparse1::operator()(std::mutex &mut) const Permutation &per = pset.get(iper); IntSequence percoor(coor.size()); per.apply(coor, percoor); - for (const auto & it : eset) + for (const auto &it : eset) if (it.numClasses() == t.dimen()) { StackProduct<UGSTensor> sp(cont, it, out.getSym()); @@ -611,7 +611,7 @@ UnfoldedStackContainer::multAndAddStacks(const IntSequence &fi, { Permutation sort_per(ui.getCoor()); sort_per.inverse(); - for (const auto & it : eset) + for (const auto &it : eset) if (it.numClasses() == g.dimen()) { StackProduct<UGSTensor> sp(*this, it, sort_per, out.getSym()); diff --git a/dynare++/tl/cc/stack_container.hh b/dynare++/tl/cc/stack_container.hh index d5800df4202d4b7d12ddb0cd1f2e385e20a5f1a1..e1a3e79be5f3b1b6ebf2233732c371a3f22970c1 100644 --- a/dynare++/tl/cc/stack_container.hh +++ b/dynare++/tl/cc/stack_container.hh @@ -107,12 +107,12 @@ from zero types, or unit matrices are deleted. See kron_prod.hh for an explanation. */ -template <class _Ttype> +template<class _Ttype> class StackContainerInterface { public: using _Ctype = TensorContainer<_Ttype>; - enum class itype { matrix, unit, zero}; + enum class itype { matrix, unit, zero }; public: StackContainerInterface() = default; virtual ~StackContainerInterface() = default; @@ -145,7 +145,7 @@ public: It does not own its tensors. */ -template <class _Ttype> +template<class _Ttype> class StackContainer : virtual public StackContainerInterface<_Ttype> { public: @@ -347,7 +347,7 @@ protected: on four variables, the third being u′ a dummy and always returning zero if dimension of u′ is positive. */ -template <class _Ttype> +template<class _Ttype> class ZContainer : public StackContainer<_Ttype> { public: @@ -429,7 +429,7 @@ public: third one is dummy, and always returns zero. The first stack corresponds to a container of g*. */ -template <class _Ttype> +template<class _Ttype> class GContainer : public StackContainer<_Ttype> { public: @@ -503,7 +503,7 @@ public: equivalence can have permuted classes by some given permutation. Nothing else is interesting. */ -template <class _Ttype> +template<class _Ttype> class StackProduct { public: @@ -614,7 +614,7 @@ public: /* Here we only inherit from Kronecker product KronProdAllOptim, only to allow for a constructor constructing from StackProduct. */ -template <class _Ttype> +template<class _Ttype> class KronProdStack : public KronProdAllOptim { public: diff --git a/dynare++/tl/cc/symmetry.cc b/dynare++/tl/cc/symmetry.cc index f41c48c291aa40fee254eadb5bd0bf85e089d0a0..72f896bed3e25ded954b11a2d0331fb163a0e024 100644 --- a/dynare++/tl/cc/symmetry.cc +++ b/dynare++/tl/cc/symmetry.cc @@ -116,7 +116,7 @@ symiterator::operator++() InducedSymmetries::InducedSymmetries(const Equivalence &e, const Symmetry &s) { - for (const auto & i : e) + for (const auto &i : e) emplace_back(s, i); } diff --git a/dynare++/tl/cc/t_container.hh b/dynare++/tl/cc/t_container.hh index b81d03fc44cf800365b991092f35009c3ff685b3..4f097e5d62e928db8b8b0ee71fbd99cad6c5692c 100644 --- a/dynare++/tl/cc/t_container.hh +++ b/dynare++/tl/cc/t_container.hh @@ -136,7 +136,8 @@ public: insert(std::make_unique<_Ttype>(first_row, num, *(it.second))); } - TensorContainer<_Ttype> &operator=(const TensorContainer<_Ttype> &c) + TensorContainer<_Ttype> & + operator=(const TensorContainer<_Ttype> &c) { n = c.n; m.clear(); @@ -182,7 +183,7 @@ public: TL_RAISE_IF(check(t->getSym()), "Tensor already in container in TensorContainer::insert"); if (!t->isFinite()) - throw TLException(__FILE__, __LINE__, "NaN or Inf asserted in TensorContainer::insert"); + throw TLException(__FILE__, __LINE__, "NaN or Inf asserted in TensorContainer::insert"); m.emplace(t->getSym(), std::move(t)); } diff --git a/dynare++/tl/cc/t_polynomial.hh b/dynare++/tl/cc/t_polynomial.hh index 8a876ae9fa87d4693238a1e340882366939c34c6..1b2905310903e0a451ef529604c25fa6c7dbd9f8 100644 --- a/dynare++/tl/cc/t_polynomial.hh +++ b/dynare++/tl/cc/t_polynomial.hh @@ -101,7 +101,8 @@ public: struct dummy { using type = T; }; template<class T> - const T &getNext() + const T & + getNext() { return getNext(dummy<T>()); } @@ -128,7 +129,7 @@ private: See documentation to TensorPolynomial::derivative() and TensorPolynomial::evalPartially() for details. */ -template <class _Ttype, class _TGStype, class _Stype> +template<class _Ttype, class _TGStype, class _Stype> class TensorPolynomial : public TensorContainer<_Ttype> { int nr; @@ -138,18 +139,18 @@ class TensorPolynomial : public TensorContainer<_Ttype> public: TensorPolynomial(int rows, int vars) : TensorContainer<_Ttype>(1), - nr(rows), nv(vars), maxdim(0) + nr(rows), nv(vars), maxdim(0) { } TensorPolynomial(const TensorPolynomial<_Ttype, _TGStype, _Stype> &tp, int k) : TensorContainer<_Ttype>(tp), - nr(tp.nr), nv(tp.nv), maxdim(0) + nr(tp.nr), nv(tp.nv), maxdim(0) { derivative(k); } TensorPolynomial(int first_row, int num, TensorPolynomial<_Ttype, _TGStype, _Stype> &tp) : TensorContainer<_Ttype>(first_row, num, tp), - nr(num), nv(tp.nv), maxdim(tp.maxdim) + nr(num), nv(tp.nv), maxdim(tp.maxdim) { } @@ -176,7 +177,7 @@ public: TensorPolynomial(const TensorPolynomial<_Ttype, _TGStype, _Stype> &tp, const Vector &xval) : TensorContainer<_Ttype>(1), - nr(tp.nrows()), nv(tp.nvars() - xval.length()), maxdim(0) + nr(tp.nrows()), nv(tp.nvars() - xval.length()), maxdim(0) { TL_RAISE_IF(nvars() < 0, "Length of xval too big in TensorPolynomial contract constructor"); @@ -472,7 +473,7 @@ public: tensor, with the number of variables equal to the number of variables of the polynomial plus 1 for ‘1’. */ -template <class _Ttype, class _TGStype, class _Stype> +template<class _Ttype, class _TGStype, class _Stype> class CompactPolynomial : public _Ttype { public: diff --git a/dynare++/tl/cc/tensor.hh b/dynare++/tl/cc/tensor.hh index a4a4b1a10e558be27fe4f8d40f8c3a1020db7584..cbeced9bb4c6fd65f7556441088974a0ec3a557b 100644 --- a/dynare++/tl/cc/tensor.hh +++ b/dynare++/tl/cc/tensor.hh @@ -83,7 +83,7 @@ class Tensor : public TwoDMatrix { public: - enum class indor {along_row, along_col}; + enum class indor { along_row, along_col }; /* The index represents n-tuple α₁…αₙ. Since its movement is dependent on the underlying tensor (with storage and symmetry), we maintain a reference to diff --git a/dynare++/tl/cc/tl_exception.hh b/dynare++/tl/cc/tl_exception.hh index cf886762221f5b1bed336f18f25ad8ed75464b7a..201f4320c3c60e08c151e15036b06798ad47cc33 100644 --- a/dynare++/tl/cc/tl_exception.hh +++ b/dynare++/tl/cc/tl_exception.hh @@ -59,7 +59,7 @@ # define TL_DEBUG 0 #endif -#define TL_RAISE(mes) \ +#define TL_RAISE(mes) \ throw TLException(__FILE__, __LINE__, mes) #define TL_RAISE_IF(expr, mes) \ diff --git a/dynare++/tl/cc/twod_matrix.hh b/dynare++/tl/cc/twod_matrix.hh index 83e1b27a210dc08d45392425f0601db9d340954b..bd45083d3fa56a31e0f855c3f55b95815aa65132 100644 --- a/dynare++/tl/cc/twod_matrix.hh +++ b/dynare++/tl/cc/twod_matrix.hh @@ -142,7 +142,6 @@ public: { } #endif - ~TwoDMatrix() override = default; TwoDMatrix &operator=(const TwoDMatrix &m) = default; diff --git a/dynare++/tl/testing/factory.hh b/dynare++/tl/testing/factory.hh index f5eab5d4943209206481470f131c8fb3db31e0b9..0dbd3ef26a9680e7ebac329aa7d87de64b9a50e7 100644 --- a/dynare++/tl/testing/factory.hh +++ b/dynare++/tl/testing/factory.hh @@ -42,7 +42,7 @@ class Factory public: double get(); // This can be used with UGSTensor, FGSTensor - template <class _Ttype> + template<class _Ttype> std::unique_ptr<_Ttype> make(int r, const Symmetry &s, const IntSequence &nvs) { @@ -53,7 +53,7 @@ public: } // This can be used with FFSTensor, UFSTensor, FRTensor, URTensor - template <class _Ttype> + template<class _Ttype> std::unique_ptr<_Ttype> make(int r, int nv, int dim) { @@ -63,7 +63,7 @@ public: return res; } - template <class _Ttype, class _Ctype> + template<class _Ttype, class _Ctype> _Ctype makeCont(int r, const IntSequence &nvs, int maxdim) { @@ -80,7 +80,7 @@ public: return res; } - template <class _Ttype, class _Ptype> + template<class _Ttype, class _Ptype> _Ptype makePoly(int r, int nv, int maxdim) { diff --git a/dynare++/tl/testing/tests.cc b/dynare++/tl/testing/tests.cc index d2f01fe5c1013b622c8a3c8b0c24711de8f2d544..559bafd6f5d7ebd503227fc639c1d6545930cff4 100644 --- a/dynare++/tl/testing/tests.cc +++ b/dynare++/tl/testing/tests.cc @@ -56,10 +56,10 @@ protected: template<class _Ttype> static bool index_forward(const Symmetry &s, const IntSequence &nvs); - template <class _Ttype> + template<class _Ttype> static bool index_backward(const Symmetry &s, const IntSequence &nvs); - template <class _Ttype> + template<class _Ttype> static bool index_offset(const Symmetry &s, const IntSequence &nvs); static bool fold_unfold(std::unique_ptr<FTensor> folded); @@ -122,7 +122,7 @@ TestRunnable::test() const /****************************************************/ /* definition of TestRunnable static methods */ /****************************************************/ -template <class _Ttype> +template<class _Ttype> bool TestRunnable::index_forward(const Symmetry &s, const IntSequence &nvs) { @@ -154,7 +154,7 @@ TestRunnable::index_forward(const Symmetry &s, const IntSequence &nvs) return fails == 0; } -template <class _Ttype> +template<class _Ttype> bool TestRunnable::index_backward(const Symmetry &s, const IntSequence &nvs) { @@ -185,7 +185,7 @@ TestRunnable::index_backward(const Symmetry &s, const IntSequence &nvs) return fails == 0; } -template <class _Ttype> +template<class _Ttype> bool TestRunnable::index_offset(const Symmetry &s, const IntSequence &nvs) { diff --git a/dynare++/utils/cc/pascal_triangle.cc b/dynare++/utils/cc/pascal_triangle.cc index dff2d6b7e7367224c56da3741cb1566d2aace7c9..8b8a63d26c78aa56631902056010e944b179e0d0 100644 --- a/dynare++/utils/cc/pascal_triangle.cc +++ b/dynare++/utils/cc/pascal_triangle.cc @@ -68,7 +68,6 @@ PascalRow::print() const std::cout << std::endl; } - namespace PascalTriangle { namespace // Anonymous namespace that is a functional equivalent of “private” @@ -127,7 +126,7 @@ namespace PascalTriangle void print() { - for (const auto & i : tr) + for (const auto &i : tr) i.print(); } } diff --git a/dynare++/utils/cc/sthread.cc b/dynare++/utils/cc/sthread.cc index 303cd7b0009f0dbfc22e090cc2f707731dc3b313..212f33572ac3b4782b60b9df803769e17a05c742 100644 --- a/dynare++/utils/cc/sthread.cc +++ b/dynare++/utils/cc/sthread.cc @@ -49,20 +49,20 @@ namespace sthread { counter++; std::thread th{[&, it] { - // The ‘it’ variable is captured by value, because otherwise the iterator may move - (*it)->operator()(mut_threads); - std::unique_lock<std::mutex> lk2{mut_cv}; - counter--; - /* First notify the thread waiting on the condition variable, then - unlock the mutex. We must do these two operations in that order, - otherwise there is a possibility of having the main process - destroying the condition variable before the thread tries to - notify it (if all other threads terminate at the same time and - bring the counter down to zero). - For that reason, we cannot use std::notify_all_at_thread_exit() */ - cv.notify_one(); - lk2.unlock(); - }}; + // The ‘it’ variable is captured by value, because otherwise the iterator may move + (*it)->operator()(mut_threads); + std::unique_lock<std::mutex> lk2{mut_cv}; + counter--; + /* First notify the thread waiting on the condition variable, then + unlock the mutex. We must do these two operations in that order, + otherwise there is a possibility of having the main process + destroying the condition variable before the thread tries to + notify it (if all other threads terminate at the same time and + bring the counter down to zero). + For that reason, we cannot use std::notify_all_at_thread_exit() */ + cv.notify_one(); + lk2.unlock(); + }}; th.detach(); ++it; cv.wait(lk, [&] { return counter < max_parallel_threads; });