<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.20" xml:lang="en-US">
  <compounddef id="gaussquad_8cpp" kind="file" language="C++">
    <compoundname>gaussquad.cpp</compoundname>
    <includes refid="gaussquad_8hpp" local="yes">gaussquad.hpp</includes>
    <includes local="no">cmath</includes>
    <includes local="no">cassert</includes>
    <includes local="no">iostream</includes>
    <incdepgraph>
      <node id="3">
        <label>functional</label>
      </node>
      <node id="1">
        <label>/Users/robertshaw/devfiles/libecpint/src/lib/gaussquad.cpp</label>
        <link refid="gaussquad_8cpp"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="5" relation="include">
        </childnode>
        <childnode refid="6" relation="include">
        </childnode>
        <childnode refid="7" relation="include">
        </childnode>
      </node>
      <node id="5">
        <label>cmath</label>
      </node>
      <node id="6">
        <label>cassert</label>
      </node>
      <node id="4">
        <label>vector</label>
      </node>
      <node id="7">
        <label>iostream</label>
      </node>
      <node id="2">
        <label>gaussquad.hpp</label>
        <link refid="gaussquad_8hpp"/>
        <childnode refid="3" relation="include">
        </childnode>
        <childnode refid="4" relation="include">
        </childnode>
      </node>
    </incdepgraph>
    <innernamespace refid="namespacelibecpint">libecpint</innernamespace>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="comment">/*<sp/></highlight></codeline>
<codeline lineno="2"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/><sp/>Copyright<sp/>(c)<sp/>2020<sp/>Robert<sp/>Shaw</highlight></codeline>
<codeline lineno="3"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/><sp/>This<sp/>file<sp/>is<sp/>a<sp/>part<sp/>of<sp/>Libecpint.</highlight></codeline>
<codeline lineno="4"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="5"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/><sp/>Permission<sp/>is<sp/>hereby<sp/>granted,<sp/>free<sp/>of<sp/>charge,<sp/>to<sp/>any<sp/>person<sp/>obtaining</highlight></codeline>
<codeline lineno="6"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/><sp/>a<sp/>copy<sp/>of<sp/>this<sp/>software<sp/>and<sp/>associated<sp/>documentation<sp/>files<sp/>(the</highlight></codeline>
<codeline lineno="7"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/><sp/>&quot;Software&quot;),<sp/>to<sp/>deal<sp/>in<sp/>the<sp/>Software<sp/>without<sp/>restriction,<sp/>including</highlight></codeline>
<codeline lineno="8"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/><sp/>without<sp/>limitation<sp/>the<sp/>rights<sp/>to<sp/>use,<sp/>copy,<sp/>modify,<sp/>merge,<sp/>publish,</highlight></codeline>
<codeline lineno="9"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/><sp/>distribute,<sp/>sublicense,<sp/>and/or<sp/>sell<sp/>copies<sp/>of<sp/>the<sp/>Software,<sp/>and<sp/>to</highlight></codeline>
<codeline lineno="10"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/><sp/>permit<sp/>persons<sp/>to<sp/>whom<sp/>the<sp/>Software<sp/>is<sp/>furnished<sp/>to<sp/>do<sp/>so,<sp/>subject<sp/>to</highlight></codeline>
<codeline lineno="11"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/><sp/>the<sp/>following<sp/>conditions:</highlight></codeline>
<codeline lineno="12"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="13"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/><sp/>The<sp/>above<sp/>copyright<sp/>notice<sp/>and<sp/>this<sp/>permission<sp/>notice<sp/>shall<sp/>be</highlight></codeline>
<codeline lineno="14"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/><sp/>included<sp/>in<sp/>all<sp/>copies<sp/>or<sp/>substantial<sp/>portions<sp/>of<sp/>the<sp/>Software.</highlight></codeline>
<codeline lineno="15"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="16"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/><sp/>THE<sp/>SOFTWARE<sp/>IS<sp/>PROVIDED<sp/>&quot;AS<sp/>IS&quot;,<sp/>WITHOUT<sp/>WARRANTY<sp/>OF<sp/>ANY<sp/>KIND,</highlight></codeline>
<codeline lineno="17"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/><sp/>EXPRESS<sp/>OR<sp/>IMPLIED,<sp/>INCLUDING<sp/>BUT<sp/>NOT<sp/>LIMITED<sp/>TO<sp/>THE<sp/>WARRANTIES<sp/>OF</highlight></codeline>
<codeline lineno="18"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/><sp/>MERCHANTABILITY,<sp/>FITNESS<sp/>FOR<sp/>A<sp/>PARTICULAR<sp/>PURPOSE<sp/>AND</highlight></codeline>
<codeline lineno="19"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/><sp/>NONINFRINGEMENT.<sp/>IN<sp/>NO<sp/>EVENT<sp/>SHALL<sp/>THE<sp/>AUTHORS<sp/>OR<sp/>COPYRIGHT<sp/>HOLDERS<sp/>BE</highlight></codeline>
<codeline lineno="20"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/><sp/>LIABLE<sp/>FOR<sp/>ANY<sp/>CLAIM,<sp/>DAMAGES<sp/>OR<sp/>OTHER<sp/>LIABILITY,<sp/>WHETHER<sp/>IN<sp/>AN<sp/>ACTION</highlight></codeline>
<codeline lineno="21"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/><sp/>OF<sp/>CONTRACT,<sp/>TORT<sp/>OR<sp/>OTHERWISE,<sp/>ARISING<sp/>FROM,<sp/>OUT<sp/>OF<sp/>OR<sp/>IN<sp/>CONNECTION</highlight></codeline>
<codeline lineno="22"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/><sp/>WITH<sp/>THE<sp/>SOFTWARE<sp/>OR<sp/>THE<sp/>USE<sp/>OR<sp/>OTHER<sp/>DEALINGS<sp/>IN<sp/>THE<sp/>SOFTWARE.</highlight></codeline>
<codeline lineno="23"><highlight class="comment"><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="24"><highlight class="normal"></highlight></codeline>
<codeline lineno="25"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;<ref refid="gaussquad_8hpp" kindref="compound">gaussquad.hpp</ref>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="26"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;cmath&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="27"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;cassert&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="28"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;iostream&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="29"><highlight class="normal"></highlight></codeline>
<codeline lineno="30"><highlight class="normal"></highlight><highlight class="keyword">namespace<sp/></highlight><highlight class="normal"><ref refid="namespacelibecpint" kindref="compound">libecpint</ref><sp/>{</highlight></codeline>
<codeline lineno="31"><highlight class="normal"></highlight></codeline>
<codeline lineno="32"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Constructor</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="33" refid="classlibecpint_1_1_g_c_quadrature_1a563235d3d5d9a19a5e4a77aec13f5dfd" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a563235d3d5d9a19a5e4a77aec13f5dfd" kindref="member">GCQuadrature::GCQuadrature</ref>()<sp/>{</highlight></codeline>
<codeline lineno="34"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Currently<sp/>does<sp/>nothing</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="35"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="36"><highlight class="normal"></highlight></codeline>
<codeline lineno="37"><highlight class="normal"></highlight></codeline>
<codeline lineno="38" refid="classlibecpint_1_1_g_c_quadrature_1abb70ca948ba7f768a59c74d9f93a471a" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a563235d3d5d9a19a5e4a77aec13f5dfd" kindref="member">GCQuadrature::GCQuadrature</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classlibecpint_1_1_g_c_quadrature" kindref="compound">GCQuadrature</ref><sp/>&amp;other)<sp/>{</highlight></codeline>
<codeline lineno="39"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ae0bacb92b24e1ad6916f0d24aec69a7a" kindref="member">maxN</ref><sp/>=<sp/>other.<ref refid="classlibecpint_1_1_g_c_quadrature_1ae0bacb92b24e1ad6916f0d24aec69a7a" kindref="member">maxN</ref>;</highlight></codeline>
<codeline lineno="40"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ab1d484bbe747fcb54097eb087ae1f1fd" kindref="member">M</ref><sp/>=<sp/>other.<ref refid="classlibecpint_1_1_g_c_quadrature_1ab1d484bbe747fcb54097eb087ae1f1fd" kindref="member">M</ref>;</highlight></codeline>
<codeline lineno="41"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a7aa031524de2fd28eef7910c8cc78aba" kindref="member">I</ref><sp/>=<sp/>other.<ref refid="classlibecpint_1_1_g_c_quadrature_1a7aa031524de2fd28eef7910c8cc78aba" kindref="member">I</ref>;</highlight></codeline>
<codeline lineno="42"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a02321bf542c18ca347e8e3b086b6f0ea" kindref="member">t</ref><sp/>=<sp/>other.<ref refid="classlibecpint_1_1_g_c_quadrature_1a02321bf542c18ca347e8e3b086b6f0ea" kindref="member">t</ref>;</highlight></codeline>
<codeline lineno="43"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a2db3cb9548003ddb02baaa533651479e" kindref="member">x</ref><sp/>=<sp/>other.<ref refid="classlibecpint_1_1_g_c_quadrature_1a2db3cb9548003ddb02baaa533651479e" kindref="member">x</ref>;</highlight></codeline>
<codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ac784cc6c177d4c461dbb12a43e515778" kindref="member">w</ref><sp/>=<sp/>other.<ref refid="classlibecpint_1_1_g_c_quadrature_1ac784cc6c177d4c461dbb12a43e515778" kindref="member">w</ref>;</highlight></codeline>
<codeline lineno="45"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="46"><highlight class="normal"></highlight></codeline>
<codeline lineno="47"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Initialise<sp/>the<sp/>quadrature<sp/>grid</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="48"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>As<sp/>described<sp/>in<sp/>both<sp/>Perez92<sp/>and<sp/>Perez93</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="49" refid="classlibecpint_1_1_g_c_quadrature_1a2757549e5f47cfb8ae142a60db947ae3" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a2757549e5f47cfb8ae142a60db947ae3" kindref="member">GCQuadrature::initGrid</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>points,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="namespacelibecpint_1a61c66c38649b648ca25caaff9ebc6c3f" kindref="member">GCTYPE</ref><sp/>_t)<sp/>{</highlight></codeline>
<codeline lineno="50"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a02321bf542c18ca347e8e3b086b6f0ea" kindref="member">t</ref><sp/>=<sp/>_t;</highlight></codeline>
<codeline lineno="51"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="52"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Initialise<sp/>parameters<sp/>for<sp/>grid</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="53"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>p;</highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="classlibecpint_1_1_g_c_quadrature_1a02321bf542c18ca347e8e3b086b6f0ea" kindref="member">t</ref><sp/>==<sp/><ref refid="namespacelibecpint_1a61c66c38649b648ca25caaff9ebc6c3faf2e6a20e628fc9be0ff38027d732664a" kindref="member">ONEPOINT</ref>)<sp/>{<sp/></highlight><highlight class="comment">//<sp/>Perez92<sp/>one<sp/>point<sp/>method</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="55"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>We<sp/>need<sp/>the<sp/>number<sp/>of<sp/>points<sp/>to<sp/>be<sp/>of<sp/>the<sp/>form</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="56"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>2^p<sp/>-<sp/>1<sp/>for<sp/>some<sp/>power<sp/>p.<sp/></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="57"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>p<sp/>=<sp/>(int)<sp/>floor(log(points<sp/>+<sp/>1)/log(2));</highlight></codeline>
<codeline lineno="58"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ae0bacb92b24e1ad6916f0d24aec69a7a" kindref="member">maxN</ref><sp/>=<sp/>pow(2,<sp/>p)<sp/>-<sp/>1;</highlight></codeline>
<codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="classlibecpint_1_1_g_c_quadrature_1a02321bf542c18ca347e8e3b086b6f0ea" kindref="member">t</ref><sp/>==<sp/><ref refid="namespacelibecpint_1a61c66c38649b648ca25caaff9ebc6c3fa56b5dd9ab1cc8971737f1c6c14d32e52" kindref="member">TWOPOINT</ref>)<sp/>{<sp/></highlight><highlight class="comment">//<sp/>Perez93<sp/>two<sp/>point<sp/>method</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Here<sp/>we<sp/>need<sp/>it<sp/>instead<sp/>to<sp/>be<sp/>of<sp/>the<sp/>form</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="61"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>3<sp/>*<sp/>2^p<sp/>-<sp/>1<sp/>for<sp/>some<sp/>p.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="62"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>p<sp/>=<sp/>(int)<sp/>floor(log((points<sp/>+<sp/>2)/3.0)/log(2));</highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ae0bacb92b24e1ad6916f0d24aec69a7a" kindref="member">maxN</ref><sp/>=<sp/>3*pow(2,<sp/>p)<sp/>-<sp/>1;</highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="65"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ab1d484bbe747fcb54097eb087ae1f1fd" kindref="member">M</ref><sp/>=<sp/>(<ref refid="classlibecpint_1_1_g_c_quadrature_1ae0bacb92b24e1ad6916f0d24aec69a7a" kindref="member">maxN</ref>-1)/2;<sp/></highlight><highlight class="comment">//<sp/>Midpoint</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="66"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>initialise<sp/>arrays</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a2db3cb9548003ddb02baaa533651479e" kindref="member">x</ref>.assign(<ref refid="classlibecpint_1_1_g_c_quadrature_1ae0bacb92b24e1ad6916f0d24aec69a7a" kindref="member">maxN</ref>,<sp/>0.0);</highlight></codeline>
<codeline lineno="69"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ac784cc6c177d4c461dbb12a43e515778" kindref="member">w</ref>.assign(<ref refid="classlibecpint_1_1_g_c_quadrature_1ae0bacb92b24e1ad6916f0d24aec69a7a" kindref="member">maxN</ref>,<sp/>0.0);</highlight></codeline>
<codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>At<sp/>the<sp/>midpoint,<sp/>M,<sp/>x[M]<sp/>=<sp/>0<sp/>and<sp/>w[M]<sp/>=<sp/>1</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="72"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a2db3cb9548003ddb02baaa533651479e" kindref="member">x</ref>[<ref refid="classlibecpint_1_1_g_c_quadrature_1ab1d484bbe747fcb54097eb087ae1f1fd" kindref="member">M</ref>]<sp/>=<sp/>0.0;<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ac784cc6c177d4c461dbb12a43e515778" kindref="member">w</ref>[<ref refid="classlibecpint_1_1_g_c_quadrature_1ab1d484bbe747fcb54097eb087ae1f1fd" kindref="member">M</ref>]<sp/>=<sp/>1.0;</highlight></codeline>
<codeline lineno="73"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>The<sp/>rest<sp/>of<sp/>the<sp/>abscissae<sp/>and<sp/>weights<sp/>are<sp/>then<sp/>given<sp/>by:</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="74"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>z_i<sp/>=<sp/>i*Pi<sp/>/<sp/>(maxN<sp/>+<sp/>1),<sp/>s_i<sp/>=<sp/>sin(z_i),<sp/>c_i<sp/>=<sp/>cos(z_i)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>x_i<sp/>=<sp/>1<sp/>+<sp/>2/(3*pi)<sp/>*<sp/>[<sp/>(3<sp/>+<sp/>2*s_i^2)<sp/>*<sp/>c_i<sp/>*<sp/>s_i<sp/>-<sp/>3z_i]</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="76"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>(3(maxN<sp/>+<sp/>1)/16)<sp/>*<sp/>w_i<sp/>=<sp/>s_i^4</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="77"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>We<sp/>then<sp/>note<sp/>that<sp/>s_(i+1)<sp/>=<sp/>c_1<sp/>s_i<sp/>+<sp/>s_1<sp/>c_i</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="78"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>and<sp/>c_(i+1)<sp/>=<sp/>c_1<sp/>c_i<sp/>-<sp/>s_1<sp/>s_i</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="79"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>with<sp/>z_(i+1)<sp/>=<sp/>z_i<sp/>+<sp/>z_1</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="80"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Clearly<sp/>s_(maxN<sp/>+<sp/>1<sp/>-<sp/>i)<sp/>=<sp/>s_i</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="81"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>and<sp/>c_(maxN<sp/>+<sp/>1<sp/>-<sp/>i)<sp/>=<sp/>-c_i</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="82"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Therefore<sp/>x_(maxN<sp/>+<sp/>1<sp/>-<sp/>i)<sp/>=<sp/>-x_i</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="83"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>and<sp/>w_(maxN<sp/>+<sp/>1<sp/>-<sp/>i)<sp/>=<sp/>w_i</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="84"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Meaning<sp/>that<sp/>we<sp/>only<sp/>have<sp/>to<sp/>calculate<sp/>half<sp/>the<sp/>weights<sp/>and<sp/>abscissae</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="85"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>z1<sp/>=<sp/><ref refid="mathutil_8hpp_1ae71449b1cc6e6250b91f539153a7a0d3" kindref="member">M_PI</ref><sp/>/<sp/>((double)(<ref refid="classlibecpint_1_1_g_c_quadrature_1ae0bacb92b24e1ad6916f0d24aec69a7a" kindref="member">maxN</ref><sp/>+<sp/>1));</highlight></codeline>
<codeline lineno="86"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>c1<sp/>=<sp/>cos(z1);<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>s1<sp/>=<sp/>sin(z1);</highlight></codeline>
<codeline lineno="87"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>zi,<sp/>si,<sp/>ci,<sp/>zi1,<sp/>si1,<sp/>ci1;<sp/></highlight><highlight class="comment">//z_i,<sp/>s_i,<sp/>c_i,<sp/>z_(i+1),<sp/>s_(i+1),<sp/>c_(i+1)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="88"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>zi1<sp/>=<sp/>z1;<sp/>si1<sp/>=<sp/>s1;<sp/>ci1<sp/>=<sp/>c1;</highlight></codeline>
<codeline lineno="89"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>o23pi<sp/>=<sp/>2.0<sp/>/<sp/>(3.0<sp/>*<sp/><ref refid="mathutil_8hpp_1ae71449b1cc6e6250b91f539153a7a0d3" kindref="member">M_PI</ref>);<sp/></highlight><highlight class="comment">//<sp/>Convenient</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="90"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>s2;<sp/></highlight><highlight class="comment">//si<sp/>*<sp/>si</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="91"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n<sp/>=<sp/>0;<sp/>n<sp/>&lt;<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ab1d484bbe747fcb54097eb087ae1f1fd" kindref="member">M</ref>;<sp/>n++)<sp/>{</highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>First<sp/>update<sp/>zi,<sp/>si,<sp/>ci</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>zi<sp/>=<sp/>zi1;</highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>si<sp/>=<sp/>si1;</highlight></codeline>
<codeline lineno="95"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ci<sp/>=<sp/>ci1;</highlight></codeline>
<codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>s2<sp/>=<sp/>si<sp/>*<sp/>si;</highlight></codeline>
<codeline lineno="97"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="98"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Now<sp/>determine<sp/>the<sp/>w<sp/>and<sp/>x<sp/>values</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="99"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ac784cc6c177d4c461dbb12a43e515778" kindref="member">w</ref>[<ref refid="classlibecpint_1_1_g_c_quadrature_1ae0bacb92b24e1ad6916f0d24aec69a7a" kindref="member">maxN</ref><sp/>-<sp/>1<sp/>-<sp/>n]<sp/>=<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ac784cc6c177d4c461dbb12a43e515778" kindref="member">w</ref>[n]<sp/>=<sp/>s2<sp/>*<sp/>s2;</highlight></codeline>
<codeline lineno="100"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a2db3cb9548003ddb02baaa533651479e" kindref="member">x</ref>[n]<sp/>=<sp/>1<sp/>+<sp/>o23pi<sp/>*<sp/>(<sp/>(3.0<sp/>+<sp/>2.0<sp/>*<sp/>s2)<sp/>*<sp/>ci<sp/>*<sp/>si<sp/>-<sp/>3.0*zi<sp/>);</highlight></codeline>
<codeline lineno="101"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a2db3cb9548003ddb02baaa533651479e" kindref="member">x</ref>[<ref refid="classlibecpint_1_1_g_c_quadrature_1ae0bacb92b24e1ad6916f0d24aec69a7a" kindref="member">maxN</ref><sp/>-<sp/>1<sp/>-<sp/>n]<sp/>=<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a2db3cb9548003ddb02baaa533651479e" kindref="member">x</ref>[n];</highlight></codeline>
<codeline lineno="102"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a2db3cb9548003ddb02baaa533651479e" kindref="member">x</ref>[n]<sp/>=<sp/>-<ref refid="classlibecpint_1_1_g_c_quadrature_1a2db3cb9548003ddb02baaa533651479e" kindref="member">x</ref>[n];</highlight></codeline>
<codeline lineno="103"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="104"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Then<sp/>update<sp/>zi1,<sp/>si1,<sp/>ci1</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="105"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>zi1<sp/>=<sp/>zi<sp/>+<sp/>z1;</highlight></codeline>
<codeline lineno="106"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>si1<sp/>=<sp/>c1<sp/>*<sp/>si<sp/>+<sp/>s1<sp/>*<sp/>ci;</highlight></codeline>
<codeline lineno="107"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ci1<sp/>=<sp/>c1<sp/>*<sp/>ci<sp/>-<sp/>s1<sp/>*<sp/>si;</highlight></codeline>
<codeline lineno="108"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="110"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*std::cout<sp/>&lt;&lt;<sp/>maxN<sp/>&lt;&lt;<sp/>&quot;<sp/>&quot;<sp/>&lt;&lt;<sp/>M<sp/>&lt;&lt;<sp/>&quot;<sp/>&quot;<sp/>&lt;&lt;<sp/>start<sp/>&lt;&lt;<sp/>&quot;<sp/>&quot;<sp/>&lt;&lt;<sp/>end<sp/>&lt;&lt;<sp/>&quot;\n&quot;;</highlight></codeline>
<codeline lineno="111"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>for<sp/>(int<sp/>q<sp/>=<sp/>0;<sp/>q<sp/>&lt;<sp/>maxN;<sp/>q++)<sp/>std::cout<sp/>&lt;&lt;<sp/>x[q]<sp/>&lt;&lt;<sp/>&quot;<sp/>&quot;<sp/>&lt;&lt;<sp/>w[q]<sp/>&lt;&lt;<sp/>&quot;\n&quot;;*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="112"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="113"><highlight class="normal"></highlight></codeline>
<codeline lineno="114"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Perform<sp/>the<sp/>GC<sp/>integration<sp/>on<sp/>the<sp/>function<sp/>f</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="115" refid="classlibecpint_1_1_g_c_quadrature_1addc19b8f39a675e834cded78eb0f7668" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/>std::pair&lt;double,<sp/>bool&gt;<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1addc19b8f39a675e834cded78eb0f7668" kindref="member">GCQuadrature::integrate</ref>(</highlight></codeline>
<codeline lineno="116"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>std::function&lt;</highlight><highlight class="keywordtype">double</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">double</highlight><highlight class="normal">,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal">*,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal">)&gt;<sp/>&amp;<ref refid="namespaceunrol__radial_1a582dde0241adf8b3a95b4459b4d49b2b" kindref="member">f</ref>,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>*params,</highlight></codeline>
<codeline lineno="117"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>tolerance,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>start,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>end)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="118"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>converged<sp/>=<sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">;<sp/></highlight><highlight class="comment">//<sp/>0<sp/>for<sp/>converged,<sp/>-1<sp/>for<sp/>not<sp/>converged</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="119"><highlight class="normal"></highlight></codeline>
<codeline lineno="120"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a7aa031524de2fd28eef7910c8cc78aba" kindref="member">I</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="121"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="classlibecpint_1_1_g_c_quadrature_1a02321bf542c18ca347e8e3b086b6f0ea" kindref="member">t</ref><sp/>==<sp/><ref refid="namespacelibecpint_1a61c66c38649b648ca25caaff9ebc6c3faf2e6a20e628fc9be0ff38027d732664a" kindref="member">ONEPOINT</ref>)<sp/>{</highlight></codeline>
<codeline lineno="122"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Perez92<sp/>Case</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="123"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Integration<sp/>proceeds<sp/>in<sp/>the<sp/>sequence<sp/>T_1,<sp/>T_3,<sp/>T_7,<sp/>...,<sp/>T_{maxN}</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="124"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>where<sp/>T_m<sp/>=<sp/>(3(m+1)/16)I_m</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="125"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>by<sp/>using<sp/>the<sp/>fact<sp/>that<sp/>T_{2m<sp/>+<sp/>1}<sp/>=<sp/>T_{m}<sp/>+<sp/>sum_{k<sp/>=<sp/>0}^m<sp/>w_{2k+1}f(x_{2k+1})</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="126"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>The<sp/>indices<sp/>in<sp/>terms<sp/>of<sp/>the<sp/>maxN<sp/>indices<sp/>are<sp/>given<sp/>by<sp/></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="127"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>2k<sp/>+<sp/>1<sp/>=<sp/>(2k<sp/>+<sp/>1)<sp/>*<sp/>M<sp/>/<sp/>2^n<sp/>=<sp/>(2k<sp/>+<sp/>1)<sp/>*<sp/>p</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="128"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>and<sp/>checking<sp/>convergence<sp/>via<sp/>whether</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>(T_{2m<sp/>+<sp/>1}<sp/>-<sp/>2T_m)^2<sp/>&lt;=<sp/>|T_{2m+1}<sp/>-<sp/>4T_{(m-1)/2}|<sp/>x<sp/>tolerance</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Tn,<sp/>T2n1,<sp/>Tn12;<sp/></highlight><highlight class="comment">//<sp/>T_n,<sp/>T_{2n+1}<sp/>and<sp/>4T_{(n-1)/2}</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="131"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="132"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Initialise<sp/>values,<sp/></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="133"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Single<sp/>point<sp/>integration<sp/>would<sp/>use<sp/>midpoint,<sp/>M</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="134"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Tn<sp/>=<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ac784cc6c177d4c461dbb12a43e515778" kindref="member">w</ref>[<ref refid="classlibecpint_1_1_g_c_quadrature_1ab1d484bbe747fcb54097eb087ae1f1fd" kindref="member">M</ref>]*<ref refid="namespaceunrol__radial_1a582dde0241adf8b3a95b4459b4d49b2b" kindref="member">f</ref>(<ref refid="classlibecpint_1_1_g_c_quadrature_1a2db3cb9548003ddb02baaa533651479e" kindref="member">x</ref>[<ref refid="classlibecpint_1_1_g_c_quadrature_1ab1d484bbe747fcb54097eb087ae1f1fd" kindref="member">M</ref>],<sp/>params,<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ab1d484bbe747fcb54097eb087ae1f1fd" kindref="member">M</ref>);</highlight></codeline>
<codeline lineno="135"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Tn12<sp/>=<sp/>2.0<sp/>*<sp/>Tn;</highlight></codeline>
<codeline lineno="136"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="137"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Main<sp/>loop</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="138"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n<sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="139"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>dT;<sp/></highlight><highlight class="comment">//<sp/>T_{2n+1}<sp/>-<sp/>2T_n</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="140"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ix;<sp/></highlight><highlight class="comment">//<sp/>Index<sp/>needs<sp/>to<sp/>be<sp/>calculated<sp/>to<sp/>know<sp/>which<sp/>points<sp/>to<sp/>use</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="141"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>p<sp/>=<sp/>(<ref refid="classlibecpint_1_1_g_c_quadrature_1ab1d484bbe747fcb54097eb087ae1f1fd" kindref="member">M</ref>+1)<sp/>/<sp/>2;<sp/></highlight><highlight class="comment">//<sp/>M<sp/>/<sp/>2^n<sp/></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="142"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(n<sp/>&lt;<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ae0bacb92b24e1ad6916f0d24aec69a7a" kindref="member">maxN</ref><sp/>&amp;&amp;<sp/>!converged)<sp/>{</highlight></codeline>
<codeline lineno="143"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Compute<sp/>T_{2n+1}</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="144"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>T2n1<sp/>=<sp/>Tn<sp/>+<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a71cf9df0ba68012d38f46529d68c3115" kindref="member">sumTerms</ref>(<ref refid="namespaceunrol__radial_1a582dde0241adf8b3a95b4459b4d49b2b" kindref="member">f</ref>,<sp/>params,<sp/>n,<sp/>start,<sp/>end,<sp/>p,<sp/>2);</highlight></codeline>
<codeline lineno="145"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="146"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Check<sp/>convergence</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="147"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dT<sp/>=<sp/>T2n1<sp/>-<sp/>2.0*Tn;</highlight></codeline>
<codeline lineno="148"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>n<sp/>=<sp/>2*n<sp/>+<sp/>1;</highlight></codeline>
<codeline lineno="149"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(dT*dT<sp/>&lt;=<sp/>fabs(T2n1<sp/>-<sp/>Tn12)*tolerance)<sp/>{</highlight></codeline>
<codeline lineno="150"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>converged<sp/>=<sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">;<sp/><sp/></highlight></codeline>
<codeline lineno="151"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="152"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Tn12<sp/>=<sp/>4.0<sp/>*<sp/>Tn;<sp/></highlight></codeline>
<codeline lineno="153"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Tn<sp/>=<sp/>T2n1;</highlight></codeline>
<codeline lineno="154"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>p<sp/>/=<sp/>2;<sp/></highlight></codeline>
<codeline lineno="155"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="156"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="157"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Finalise<sp/>the<sp/>integral</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="158"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a7aa031524de2fd28eef7910c8cc78aba" kindref="member">I</ref><sp/>=<sp/>16.0<sp/>*<sp/>T2n1<sp/>/<sp/>(3.0*(n<sp/>+<sp/>1.0));</highlight></codeline>
<codeline lineno="159"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="160"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="classlibecpint_1_1_g_c_quadrature_1a02321bf542c18ca347e8e3b086b6f0ea" kindref="member">t</ref><sp/>==<sp/><ref refid="namespacelibecpint_1a61c66c38649b648ca25caaff9ebc6c3fa56b5dd9ab1cc8971737f1c6c14d32e52" kindref="member">TWOPOINT</ref>)<sp/>{</highlight></codeline>
<codeline lineno="161"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Perez93<sp/>case</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="162"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>We<sp/>instead<sp/>proceed<sp/>along<sp/>T_2,<sp/>T_5,<sp/>T_11,<sp/>...,<sp/>T_{2m<sp/>+<sp/>1}<sp/>where<sp/>maxN<sp/>=<sp/>2m+1</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="163"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>but<sp/>also<sp/>compute<sp/>T_1,<sp/>T_3,<sp/>...,<sp/>T_n,<sp/>T_{2n+1}<sp/>etc.<sp/>as<sp/>before,</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="164"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>where<sp/>m<sp/>+<sp/>1<sp/>=<sp/>3/2(n+1),<sp/>so<sp/>as<sp/>to<sp/>get<sp/>better<sp/>error<sp/>control</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="165"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>To<sp/>do<sp/>this,<sp/>we<sp/>use<sp/>that<sp/></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="166"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>T_{2m+1}<sp/>=<sp/>T_m<sp/>+<sp/>T_n<sp/>-<sp/>T_{(n-1)/2}<sp/>+<sp/>sum_{i=0}^{(m-2)/3}<sp/>[w_{6i+1}f(x_{6i+1})<sp/>+<sp/>w_{6i+5}f(x_{6i+5})]</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="167"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>along<sp/>with<sp/>the<sp/>same<sp/>results<sp/>as<sp/>before.<sp/></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="168"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>The<sp/>algorithm<sp/>proceeds<sp/>by<sp/>calculating<sp/>one<sp/>in<sp/>the<sp/>two-point<sp/>sequence,</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="169"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>using<sp/>an<sp/>error<sp/>of<sp/>|I_{2m+1}<sp/>-<sp/>I_m|,<sp/>then<sp/>calculates<sp/>one<sp/>in<sp/>the<sp/>one-point<sp/>sequence</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="170"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>and<sp/>uses<sp/>an<sp/>error<sp/>of<sp/>|I_m<sp/>-<sp/>I_n|,<sp/>to<sp/>check<sp/>convergence.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="171"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Tn,<sp/>Tm,<sp/>T2n1,<sp/>T2m1,<sp/>Tn12;</highlight></codeline>
<codeline lineno="172"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="173"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Initialise<sp/>values</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="174"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Tn12<sp/>=<sp/>0.0;<sp/></highlight></codeline>
<codeline lineno="175"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Tn<sp/>=<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ac784cc6c177d4c461dbb12a43e515778" kindref="member">w</ref>[<ref refid="classlibecpint_1_1_g_c_quadrature_1ab1d484bbe747fcb54097eb087ae1f1fd" kindref="member">M</ref>]*<ref refid="namespaceunrol__radial_1a582dde0241adf8b3a95b4459b4d49b2b" kindref="member">f</ref>(<ref refid="classlibecpint_1_1_g_c_quadrature_1a2db3cb9548003ddb02baaa533651479e" kindref="member">x</ref>[<ref refid="classlibecpint_1_1_g_c_quadrature_1ab1d484bbe747fcb54097eb087ae1f1fd" kindref="member">M</ref>],<sp/>params,<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ab1d484bbe747fcb54097eb087ae1f1fd" kindref="member">M</ref>);</highlight></codeline>
<codeline lineno="176"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>M2<sp/>=<sp/>(<ref refid="classlibecpint_1_1_g_c_quadrature_1ae0bacb92b24e1ad6916f0d24aec69a7a" kindref="member">maxN</ref><sp/>-<sp/>2)/3;<sp/></highlight><highlight class="comment">//Index<sp/>of<sp/>first<sp/>point<sp/>in<sp/>twopoint<sp/>sequence</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="177"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Tm<sp/>=<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ac784cc6c177d4c461dbb12a43e515778" kindref="member">w</ref>[M2]*<ref refid="namespaceunrol__radial_1a582dde0241adf8b3a95b4459b4d49b2b" kindref="member">f</ref>(<ref refid="classlibecpint_1_1_g_c_quadrature_1a2db3cb9548003ddb02baaa533651479e" kindref="member">x</ref>[M2],<sp/>params,<sp/>M2)<sp/>+<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ac784cc6c177d4c461dbb12a43e515778" kindref="member">w</ref>[<ref refid="classlibecpint_1_1_g_c_quadrature_1ae0bacb92b24e1ad6916f0d24aec69a7a" kindref="member">maxN</ref><sp/>-<sp/>M2<sp/>-<sp/>1]*<ref refid="namespaceunrol__radial_1a582dde0241adf8b3a95b4459b4d49b2b" kindref="member">f</ref>(<ref refid="classlibecpint_1_1_g_c_quadrature_1a2db3cb9548003ddb02baaa533651479e" kindref="member">x</ref>[<ref refid="classlibecpint_1_1_g_c_quadrature_1ae0bacb92b24e1ad6916f0d24aec69a7a" kindref="member">maxN</ref><sp/>-<sp/>M2<sp/>-<sp/>1],<sp/>params,<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ae0bacb92b24e1ad6916f0d24aec69a7a" kindref="member">maxN</ref><sp/>-<sp/>M2<sp/>-<sp/>1);</highlight></codeline>
<codeline lineno="178"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>p<sp/>=<sp/>(<ref refid="classlibecpint_1_1_g_c_quadrature_1ab1d484bbe747fcb54097eb087ae1f1fd" kindref="member">M</ref>+1)<sp/>/<sp/>2;<sp/></highlight><highlight class="comment">//<sp/>as<sp/>before</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="179"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>M2<sp/>=<sp/>(M2<sp/>+<sp/>1)/2;<sp/></highlight></codeline>
<codeline lineno="180"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ix;<sp/></highlight></codeline>
<codeline lineno="181"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n<sp/>=<sp/>1;<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>m<sp/>=<sp/>2;</highlight></codeline>
<codeline lineno="182"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>error;</highlight></codeline>
<codeline lineno="183"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="184"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal">(m<sp/>&lt;<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ae0bacb92b24e1ad6916f0d24aec69a7a" kindref="member">maxN</ref><sp/>&amp;&amp;<sp/>!converged)<sp/>{</highlight></codeline>
<codeline lineno="185"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Propagate<sp/>the<sp/>two-point<sp/>sequence<sp/>first<sp/></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="186"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>T2m1<sp/>=<sp/>Tm<sp/>+<sp/>Tn<sp/>-<sp/>Tn12<sp/>+<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a71cf9df0ba68012d38f46529d68c3115" kindref="member">sumTerms</ref>(<ref refid="namespaceunrol__radial_1a582dde0241adf8b3a95b4459b4d49b2b" kindref="member">f</ref>,<sp/>params,<sp/>(2*m<sp/>-<sp/>1)/3,<sp/>start,<sp/>end,<sp/>M2,<sp/>3);</highlight></codeline>
<codeline lineno="187"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="188"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Check<sp/>convergence</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="189"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>error<sp/>=<sp/>16.0<sp/>*<sp/>fabs(0.5*T2m1<sp/>-<sp/>Tm)<sp/>/<sp/>(3.0<sp/>*<sp/>(m<sp/>+<sp/>1));<sp/></highlight></codeline>
<codeline lineno="190"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(error<sp/>&gt;<sp/>tolerance)<sp/>{</highlight></codeline>
<codeline lineno="191"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Propagate<sp/>the<sp/>one-point<sp/>sequence</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="192"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>T2n1<sp/>=<sp/>Tn<sp/>+<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a71cf9df0ba68012d38f46529d68c3115" kindref="member">sumTerms</ref>(<ref refid="namespaceunrol__radial_1a582dde0241adf8b3a95b4459b4d49b2b" kindref="member">f</ref>,<sp/>params,<sp/>n,<sp/>start,<sp/>end,<sp/>p,<sp/>2);</highlight></codeline>
<codeline lineno="193"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="194"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Check<sp/>convergence<sp/>again</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="195"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>error<sp/>=<sp/>16.0<sp/>*<sp/>fabs(2.0*T2m1<sp/>-<sp/>3.0*T2n1)<sp/>/<sp/>(18.0<sp/>*<sp/>(n+1)<sp/>);</highlight></codeline>
<codeline lineno="196"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>m<sp/>=<sp/>2<sp/>*<sp/>m<sp/>+<sp/>1;</highlight></codeline>
<codeline lineno="197"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>n<sp/>=<sp/>2<sp/>*<sp/>n<sp/>+<sp/>1;</highlight></codeline>
<codeline lineno="198"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>error<sp/>&lt;<sp/>tolerance)<sp/>{</highlight></codeline>
<codeline lineno="199"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>converged<sp/>=<sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">;<sp/></highlight></codeline>
<codeline lineno="200"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="201"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Tn12<sp/>=<sp/>Tn;</highlight></codeline>
<codeline lineno="202"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Tn<sp/>=<sp/>T2n1;</highlight></codeline>
<codeline lineno="203"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Tm<sp/>=<sp/>T2m1;<sp/></highlight></codeline>
<codeline lineno="204"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>p<sp/>/=<sp/>2;</highlight></codeline>
<codeline lineno="205"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>M2<sp/>/=<sp/>2;<sp/></highlight></codeline>
<codeline lineno="206"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="207"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="208"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>m<sp/>=<sp/>2<sp/>*<sp/>m<sp/>+<sp/>1;</highlight></codeline>
<codeline lineno="209"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>converged<sp/>=<sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">;<sp/></highlight></codeline>
<codeline lineno="210"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="211"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="212"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Finalise<sp/>the<sp/>integral</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="213"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a7aa031524de2fd28eef7910c8cc78aba" kindref="member">I</ref><sp/>=<sp/>16.0<sp/>*<sp/>T2m1<sp/>/<sp/>(3.0<sp/>*<sp/>(m<sp/>+<sp/>1.0));</highlight></codeline>
<codeline lineno="214"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="215"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="216"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>{<ref refid="classlibecpint_1_1_g_c_quadrature_1a7aa031524de2fd28eef7910c8cc78aba" kindref="member">I</ref>,<sp/>converged};</highlight></codeline>
<codeline lineno="217"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="218"><highlight class="normal"></highlight></codeline>
<codeline lineno="219"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Worker<sp/>function<sp/>to<sp/>do<sp/>the<sp/>additional<sp/>sum<sp/>terms<sp/>when<sp/>going<sp/>from<sp/>I_n<sp/>to<sp/>I_{2n+1}</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="220" refid="classlibecpint_1_1_g_c_quadrature_1a71cf9df0ba68012d38f46529d68c3115" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a71cf9df0ba68012d38f46529d68c3115" kindref="member">GCQuadrature::sumTerms</ref>(</highlight></codeline>
<codeline lineno="221"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>std::function&lt;</highlight><highlight class="keywordtype">double</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">double</highlight><highlight class="normal">,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal">*,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal">)&gt;<sp/>&amp;<ref refid="namespaceunrol__radial_1a582dde0241adf8b3a95b4459b4d49b2b" kindref="member">f</ref>,</highlight></codeline>
<codeline lineno="222"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>*p,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>limit,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>start,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>end,</highlight></codeline>
<codeline lineno="223"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>shift,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>skip)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="224"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>assert(start<sp/>&gt;=<sp/>0<sp/>&amp;&amp;<sp/>start<sp/>&lt;<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ae0bacb92b24e1ad6916f0d24aec69a7a" kindref="member">maxN</ref>);</highlight></codeline>
<codeline lineno="225"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>assert(end<sp/>&gt;=<sp/>0<sp/>&amp;&amp;<sp/>end<sp/>&lt;<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ae0bacb92b24e1ad6916f0d24aec69a7a" kindref="member">maxN</ref>);</highlight></codeline>
<codeline lineno="226"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>assert(end<sp/>&gt;=<sp/>start);</highlight></codeline>
<codeline lineno="227"><highlight class="normal"></highlight></codeline>
<codeline lineno="228"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>value<sp/>=<sp/>0.0;</highlight></codeline>
<codeline lineno="229"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ix;<sp/></highlight></codeline>
<codeline lineno="230"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>0;<sp/>i<sp/>&lt;=<sp/>limit;<sp/>i+=2)<sp/>{<sp/></highlight></codeline>
<codeline lineno="231"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ix<sp/>=<sp/>(skip*i<sp/>+<sp/>1)*shift<sp/>-<sp/>1;</highlight></codeline>
<codeline lineno="232"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ix<sp/>&gt;=<sp/>start)</highlight></codeline>
<codeline lineno="233"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>value<sp/>+=<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ac784cc6c177d4c461dbb12a43e515778" kindref="member">w</ref>[ix]<sp/>*<sp/><ref refid="namespaceunrol__radial_1a582dde0241adf8b3a95b4459b4d49b2b" kindref="member">f</ref>(<ref refid="classlibecpint_1_1_g_c_quadrature_1a2db3cb9548003ddb02baaa533651479e" kindref="member">x</ref>[ix],<sp/>p,<sp/>ix);</highlight></codeline>
<codeline lineno="234"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="235"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ix<sp/>=<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ae0bacb92b24e1ad6916f0d24aec69a7a" kindref="member">maxN</ref><sp/>-<sp/>ix<sp/>-<sp/>1;<sp/></highlight></codeline>
<codeline lineno="236"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ix<sp/>&lt;=<sp/>end)</highlight></codeline>
<codeline lineno="237"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>value<sp/>+=<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ac784cc6c177d4c461dbb12a43e515778" kindref="member">w</ref>[ix]<sp/>*<sp/><ref refid="namespaceunrol__radial_1a582dde0241adf8b3a95b4459b4d49b2b" kindref="member">f</ref>(<ref refid="classlibecpint_1_1_g_c_quadrature_1a2db3cb9548003ddb02baaa533651479e" kindref="member">x</ref>[ix],<sp/>p,<sp/>ix);</highlight></codeline>
<codeline lineno="238"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="239"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>value;</highlight></codeline>
<codeline lineno="240"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="241"><highlight class="normal"></highlight></codeline>
<codeline lineno="242"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>The<sp/>GC<sp/>integrations<sp/>above<sp/>are<sp/>over<sp/>the<sp/>interval<sp/>[-1,<sp/>1]<sp/>and<sp/>thus<sp/>need<sp/>to<sp/>be<sp/>transformed</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="243"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>to<sp/>the<sp/>interval[0,<sp/>infty),<sp/>or<sp/>[rmin,<sp/>rmax].<sp/>We<sp/>do<sp/>this<sp/>by<sp/>the<sp/>logarithmic<sp/>transformation<sp/>from<sp/>Krack98</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="244"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>or<sp/>the<sp/>linear<sp/>mapping<sp/>of<sp/>Flores06,<sp/>respectively.<sp/><sp/></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="245" refid="classlibecpint_1_1_g_c_quadrature_1a4353914587c53237d1b7e0dc7bf0c920" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a4353914587c53237d1b7e0dc7bf0c920" kindref="member">GCQuadrature::transformZeroInf</ref>()<sp/>{</highlight></codeline>
<codeline lineno="246"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>ln2<sp/>=<sp/>log(2.0);</highlight></codeline>
<codeline lineno="247"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>xt;</highlight></codeline>
<codeline lineno="248"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="249"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ae0bacb92b24e1ad6916f0d24aec69a7a" kindref="member">maxN</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="250"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>xt<sp/>=<sp/>1.0<sp/>-<sp/>log(1.0-<ref refid="classlibecpint_1_1_g_c_quadrature_1a2db3cb9548003ddb02baaa533651479e" kindref="member">x</ref>[i])/ln2;</highlight></codeline>
<codeline lineno="251"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ac784cc6c177d4c461dbb12a43e515778" kindref="member">w</ref>[i]<sp/>=<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ac784cc6c177d4c461dbb12a43e515778" kindref="member">w</ref>[i]/(ln2<sp/>*<sp/>(1.0<sp/>-<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a2db3cb9548003ddb02baaa533651479e" kindref="member">x</ref>[i]));</highlight></codeline>
<codeline lineno="252"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a2db3cb9548003ddb02baaa533651479e" kindref="member">x</ref>[i]<sp/>=<sp/>xt;</highlight></codeline>
<codeline lineno="253"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="254"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="255"><highlight class="normal"></highlight></codeline>
<codeline lineno="256" refid="classlibecpint_1_1_g_c_quadrature_1ab17203b568cea63fbfc897a404583e1a" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ab17203b568cea63fbfc897a404583e1a" kindref="member">GCQuadrature::transformRMinMax</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>z,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>p)<sp/>{</highlight></codeline>
<codeline lineno="257"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>osz<sp/>=<sp/>1.0<sp/>/<sp/>sqrt(z);</highlight></codeline>
<codeline lineno="258"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="259"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Determine<sp/>interval</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="260"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>rmin<sp/>=<sp/>p<sp/>-<sp/>7.0<sp/>*<sp/>osz;</highlight></codeline>
<codeline lineno="261"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>rmin<sp/>=<sp/>rmin<sp/>&gt;<sp/>0<sp/>?<sp/>rmin<sp/>:<sp/>0.0;</highlight></codeline>
<codeline lineno="262"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>rmax<sp/>=<sp/>p<sp/>+<sp/>9.0<sp/>*<sp/>osz;</highlight></codeline>
<codeline lineno="263"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="264"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Find<sp/>the<sp/>relative<sp/>and<sp/>absolute<sp/>midpoints<sp/></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="265"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>rmid<sp/>=<sp/>0.5*(rmax<sp/>-<sp/>rmin);<sp/></highlight><highlight class="comment">//<sp/>Midpoint<sp/>of<sp/>interval<sp/>relative<sp/>to<sp/>rmin</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="266"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>amid<sp/>=<sp/>rmid<sp/>+<sp/>rmin;<sp/></highlight><highlight class="comment">//<sp/>Midpoint<sp/>of<sp/>interval</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="267"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="268"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Transform<sp/>weights<sp/>and<sp/>abscissae<sp/>by<sp/>linearly<sp/>transforming</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="269"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>both<sp/>are<sp/>scaled<sp/>by<sp/>rmid,<sp/>and<sp/>the<sp/>abscissae<sp/>are<sp/>translated<sp/>by<sp/>amid</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="270"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ae0bacb92b24e1ad6916f0d24aec69a7a" kindref="member">maxN</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="271"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a2db3cb9548003ddb02baaa533651479e" kindref="member">x</ref>[i]<sp/>=<sp/>rmid<sp/>*<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a2db3cb9548003ddb02baaa533651479e" kindref="member">x</ref>[i]<sp/>+<sp/>amid;</highlight></codeline>
<codeline lineno="272"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ac784cc6c177d4c461dbb12a43e515778" kindref="member">w</ref>[i]<sp/>*=<sp/>rmid;</highlight></codeline>
<codeline lineno="273"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="274"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="275"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="276" refid="classlibecpint_1_1_g_c_quadrature_1a18e1de0f63bc3eebe8518de1a700ff65" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a18e1de0f63bc3eebe8518de1a700ff65" kindref="member">GCQuadrature::untransformRMinMax</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>z,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>p)<sp/>{</highlight></codeline>
<codeline lineno="277"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>osz<sp/>=<sp/>1.0<sp/>/<sp/>sqrt(z);</highlight></codeline>
<codeline lineno="278"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="279"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Determine<sp/>interval</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="280"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>rmin<sp/>=<sp/>p<sp/>-<sp/>7.0<sp/>*<sp/>osz;</highlight></codeline>
<codeline lineno="281"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>rmin<sp/>=<sp/>rmin<sp/>&gt;<sp/>0<sp/>?<sp/>rmin<sp/>:<sp/>0.0;</highlight></codeline>
<codeline lineno="282"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>rmax<sp/>=<sp/>p<sp/>+<sp/>9.0<sp/>*<sp/>osz;</highlight></codeline>
<codeline lineno="283"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="284"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Find<sp/>the<sp/>relative<sp/>and<sp/>absolute<sp/>midpoints<sp/></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="285"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>rmid<sp/>=<sp/>0.5*(rmax<sp/>-<sp/>rmin);<sp/></highlight><highlight class="comment">//<sp/>Midpoint<sp/>of<sp/>interval<sp/>relative<sp/>to<sp/>rmin</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="286"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>amid<sp/>=<sp/>rmid<sp/>+<sp/>rmin;<sp/></highlight><highlight class="comment">//<sp/>Midpoint<sp/>of<sp/>interval</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="287"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="288"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Transform<sp/>weights<sp/>and<sp/>abscissae<sp/>by<sp/>linearly<sp/>transforming</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="289"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>both<sp/>are<sp/>scaled<sp/>by<sp/>rmid,<sp/>and<sp/>the<sp/>abscissae<sp/>are<sp/>translated<sp/>by<sp/>amid</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="290"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ae0bacb92b24e1ad6916f0d24aec69a7a" kindref="member">maxN</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="291"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1a2db3cb9548003ddb02baaa533651479e" kindref="member">x</ref>[i]<sp/>=<sp/>(<ref refid="classlibecpint_1_1_g_c_quadrature_1a2db3cb9548003ddb02baaa533651479e" kindref="member">x</ref>[i]<sp/>-<sp/>amid)<sp/>/<sp/>rmid;</highlight></codeline>
<codeline lineno="292"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classlibecpint_1_1_g_c_quadrature_1ac784cc6c177d4c461dbb12a43e515778" kindref="member">w</ref>[i]<sp/>/=<sp/>rmid;</highlight></codeline>
<codeline lineno="293"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="294"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="295"><highlight class="normal"></highlight></codeline>
<codeline lineno="296"><highlight class="normal">}</highlight></codeline>
    </programlisting>
    <location file="/Users/robertshaw/devfiles/libecpint/src/lib/gaussquad.cpp"/>
  </compounddef>
</doxygen>
