<?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.14">
  <compounddef id="renyientropy_8h" kind="file" language="C++">
    <compoundname>renyientropy.h</compoundname>
    <includes refid="global_8h" local="yes">../global.h</includes>
    <includes local="yes">../util/serialization/basics.h</includes>
    <includes local="no">limits</includes>
    <includes local="no">numeric</includes>
    <includes local="no">vector</includes>
    <includes refid="types_8h" local="yes">../types.h</includes>
    <includes refid="checks_8h" local="yes">../util/checks.h</includes>
    <includes refid="exponentials_8h" local="yes">../util/exponentials.h</includes>
    <includes refid="classificationerror_8h" local="yes">./classificationerror.h</includes>
    <includes refid="ientropyfunction_8h" local="yes">./ientropyfunction.h</includes>
    <includes refid="inducedentropy_8h" local="yes">./inducedentropy.h</includes>
    <includes refid="shannonentropy_8h" local="yes">./shannonentropy.h</includes>
    <includedby refid="impurities_8h" local="yes">/Users/classner/git/forpy/include/forpy/impurities/impurities.h</includedby>
    <incdepgraph>
      <node id="685">
        <label>functional</label>
      </node>
      <node id="663">
        <label>iomanip</label>
      </node>
      <node id="683">
        <label>../util/checks.h</label>
        <link refid="checks_8h"/>
        <childnode refid="684" relation="include">
        </childnode>
        <childnode refid="685" relation="include">
        </childnode>
        <childnode refid="670" relation="include">
        </childnode>
        <childnode refid="686" relation="include">
        </childnode>
        <childnode refid="672" relation="include">
        </childnode>
        <childnode refid="661" relation="include">
        </childnode>
      </node>
      <node id="670">
        <label>limits</label>
      </node>
      <node id="681">
        <label>mapbox/variant_cast.hpp</label>
      </node>
      <node id="660">
        <label>/Users/classner/git/forpy/include/forpy/impurities/renyientropy.h</label>
        <link refid="renyientropy_8h"/>
        <childnode refid="661" relation="include">
        </childnode>
        <childnode refid="669" relation="include">
        </childnode>
        <childnode refid="670" relation="include">
        </childnode>
        <childnode refid="671" relation="include">
        </childnode>
        <childnode refid="672" relation="include">
        </childnode>
        <childnode refid="673" relation="include">
        </childnode>
        <childnode refid="683" relation="include">
        </childnode>
        <childnode refid="687" relation="include">
        </childnode>
        <childnode refid="689" relation="include">
        </childnode>
        <childnode refid="690" relation="include">
        </childnode>
        <childnode refid="691" relation="include">
        </childnode>
        <childnode refid="692" relation="include">
        </childnode>
      </node>
      <node id="662">
        <label>glog/logging.h</label>
      </node>
      <node id="689">
        <label>./classificationerror.h</label>
        <link refid="classificationerror_8h"/>
        <childnode refid="661" relation="include">
        </childnode>
        <childnode refid="669" relation="include">
        </childnode>
        <childnode refid="670" relation="include">
        </childnode>
        <childnode refid="672" relation="include">
        </childnode>
        <childnode refid="687" relation="include">
        </childnode>
        <childnode refid="690" relation="include">
        </childnode>
      </node>
      <node id="688">
        <label>cmath</label>
      </node>
      <node id="671">
        <label>numeric</label>
      </node>
      <node id="667">
        <label>string</label>
      </node>
      <node id="666">
        <label>./version.h</label>
        <link refid="version_8h"/>
      </node>
      <node id="675">
        <label>map</label>
      </node>
      <node id="678">
        <label>./util/hash.h</label>
        <link refid="hash_8h"/>
        <childnode refid="679" relation="include">
        </childnode>
        <childnode refid="672" relation="include">
        </childnode>
      </node>
      <node id="674">
        <label>Eigen/Dense</label>
      </node>
      <node id="692">
        <label>./shannonentropy.h</label>
        <link refid="shannonentropy_8h"/>
        <childnode refid="661" relation="include">
        </childnode>
        <childnode refid="669" relation="include">
        </childnode>
        <childnode refid="671" relation="include">
        </childnode>
        <childnode refid="672" relation="include">
        </childnode>
        <childnode refid="673" relation="include">
        </childnode>
        <childnode refid="683" relation="include">
        </childnode>
        <childnode refid="687" relation="include">
        </childnode>
        <childnode refid="690" relation="include">
        </childnode>
      </node>
      <node id="690">
        <label>./ientropyfunction.h</label>
        <link refid="ientropyfunction_8h"/>
        <childnode refid="661" relation="include">
        </childnode>
        <childnode refid="669" relation="include">
        </childnode>
        <childnode refid="672" relation="include">
        </childnode>
        <childnode refid="673" relation="include">
        </childnode>
      </node>
      <node id="680">
        <label>./util/storage.h</label>
        <link refid="storage_8h"/>
        <childnode refid="681" relation="include">
        </childnode>
        <childnode refid="682" relation="include">
        </childnode>
      </node>
      <node id="672">
        <label>vector</label>
      </node>
      <node id="677">
        <label>utility</label>
      </node>
      <node id="669">
        <label>../util/serialization/basics.h</label>
      </node>
      <node id="687">
        <label>../util/exponentials.h</label>
        <link refid="exponentials_8h"/>
        <childnode refid="688" relation="include">
        </childnode>
        <childnode refid="661" relation="include">
        </childnode>
      </node>
      <node id="691">
        <label>./inducedentropy.h</label>
        <link refid="inducedentropy_8h"/>
        <childnode refid="669" relation="include">
        </childnode>
        <childnode refid="670" relation="include">
        </childnode>
        <childnode refid="672" relation="include">
        </childnode>
        <childnode refid="661" relation="include">
        </childnode>
        <childnode refid="683" relation="include">
        </childnode>
        <childnode refid="687" relation="include">
        </childnode>
        <childnode refid="690" relation="include">
        </childnode>
      </node>
      <node id="664">
        <label>iostream</label>
      </node>
      <node id="661">
        <label>../global.h</label>
        <link refid="global_8h"/>
        <childnode refid="662" relation="include">
        </childnode>
        <childnode refid="663" relation="include">
        </childnode>
        <childnode refid="664" relation="include">
        </childnode>
        <childnode refid="665" relation="include">
        </childnode>
        <childnode refid="666" relation="include">
        </childnode>
        <childnode refid="667" relation="include">
        </childnode>
        <childnode refid="668" relation="include">
        </childnode>
      </node>
      <node id="679">
        <label>cstddef</label>
      </node>
      <node id="668">
        <label>csignal</label>
      </node>
      <node id="665">
        <label>thread</label>
      </node>
      <node id="686">
        <label>type_traits</label>
      </node>
      <node id="673">
        <label>../types.h</label>
        <link refid="types_8h"/>
        <childnode refid="674" relation="include">
        </childnode>
        <childnode refid="675" relation="include">
        </childnode>
        <childnode refid="676" relation="include">
        </childnode>
        <childnode refid="671" relation="include">
        </childnode>
        <childnode refid="677" relation="include">
        </childnode>
        <childnode refid="672" relation="include">
        </childnode>
        <childnode refid="678" relation="include">
        </childnode>
        <childnode refid="680" relation="include">
        </childnode>
      </node>
      <node id="682">
        <label>./serialization/variant.h</label>
      </node>
      <node id="684">
        <label>algorithm</label>
      </node>
      <node id="676">
        <label>memory</label>
      </node>
    </incdepgraph>
    <invincdepgraph>
      <node id="693">
        <label>/Users/classner/git/forpy/include/forpy/impurities/renyientropy.h</label>
        <link refid="renyientropy_8h"/>
        <childnode refid="694" relation="include">
        </childnode>
      </node>
      <node id="695">
        <label>/Users/classner/git/forpy/include/forpy/gains/entropygain.h</label>
        <link refid="entropygain_8h"/>
        <childnode refid="696" relation="include">
        </childnode>
      </node>
      <node id="697">
        <label>/Users/classner/git/forpy/include/forpy/forpy.h</label>
        <link refid="forpy_8h"/>
      </node>
      <node id="696">
        <label>/Users/classner/git/forpy/include/forpy/gains/gains.h</label>
        <link refid="gains_8h"/>
        <childnode refid="697" relation="include">
        </childnode>
      </node>
      <node id="694">
        <label>/Users/classner/git/forpy/include/forpy/impurities/impurities.h</label>
        <link refid="impurities_8h"/>
        <childnode refid="695" relation="include">
        </childnode>
        <childnode refid="697" relation="include">
        </childnode>
      </node>
    </invincdepgraph>
    <innerclass refid="classforpy_1_1_renyi_entropy" prot="public">forpy::RenyiEntropy</innerclass>
    <innernamespace refid="namespaceforpy">forpy</innernamespace>
      <sectiondef kind="define">
      <memberdef kind="define" id="renyientropy_8h_1a444b5d4f17444329ba36ee3e44a2a5a1" prot="public" static="no">
        <name>FORPY_IMPURITIES_RENYIENTROPY_H_</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/classner/git/forpy/include/forpy/impurities/renyientropy.h" line="4" column="9" bodyfile="/Users/classner/git/forpy/include/forpy/impurities/renyientropy.h" bodystart="4" bodyend="-1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="func">
      <memberdef kind="function" id="renyientropy_8h_1a495cbd69d753bf61fc9a3dbda76a5155" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type></type>
        <definition>CEREAL_REGISTER_TYPE</definition>
        <argsstring>(forpy::RenyiEntropy)</argsstring>
        <name>CEREAL_REGISTER_TYPE</name>
        <param>
          <type><ref refid="classforpy_1_1_renyi_entropy" kindref="compound">forpy::RenyiEntropy</ref></type>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/classner/git/forpy/include/forpy/impurities/renyientropy.h" line="107" column="1"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="comment">/*<sp/>Author:<sp/>Christoph<sp/>Lassner.<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2"><highlight class="normal"></highlight><highlight class="preprocessor">#pragma<sp/>once</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3"><highlight class="normal"></highlight><highlight class="preprocessor">#ifndef<sp/>FORPY_IMPURITIES_RENYIENTROPY_H_</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="4" refid="renyientropy_8h_1a444b5d4f17444329ba36ee3e44a2a5a1" refkind="member"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>FORPY_IMPURITIES_RENYIENTROPY_H_</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="5"><highlight class="normal"></highlight></codeline>
<codeline lineno="6"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;../global.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="7"><highlight class="normal"></highlight></codeline>
<codeline lineno="8"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;../util/serialization/basics.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="9"><highlight class="normal"></highlight></codeline>
<codeline lineno="10"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;limits&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="11"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;numeric&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="12"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;vector&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="13"><highlight class="normal"></highlight></codeline>
<codeline lineno="14"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;../types.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="15"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;../util/checks.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="16"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;../util/exponentials.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="17"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;<ref refid="classificationerror_8h" kindref="compound">./classificationerror.h</ref>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="18"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;<ref refid="ientropyfunction_8h" kindref="compound">./ientropyfunction.h</ref>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="19"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;<ref refid="inducedentropy_8h" kindref="compound">./inducedentropy.h</ref>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="20"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;<ref refid="shannonentropy_8h" kindref="compound">./shannonentropy.h</ref>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="21"><highlight class="normal"></highlight></codeline>
<codeline lineno="22"><highlight class="normal"></highlight><highlight class="keyword">namespace<sp/></highlight><highlight class="normal"><ref refid="namespaceforpy" kindref="compound">forpy</ref><sp/>{</highlight></codeline>
<codeline lineno="34" refid="classforpy_1_1_renyi_entropy" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classforpy_1_1_renyi_entropy" kindref="compound">RenyiEntropy</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classforpy_1_1_i_entropy_function" kindref="compound">IEntropyFunction</ref><sp/>{</highlight></codeline>
<codeline lineno="35"><highlight class="normal"><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="36"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">explicit</highlight><highlight class="normal"><sp/><ref refid="classforpy_1_1_renyi_entropy_1a8b6aaf24605f1a3ac46c2b8601eae583" kindref="member">RenyiEntropy</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/>&amp;alpha);</highlight></codeline>
<codeline lineno="37" refid="classforpy_1_1_renyi_entropy_1ab83acc57d483fa7f4717f01b74671050" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"><sp/><ref refid="classforpy_1_1_renyi_entropy_1ab83acc57d483fa7f4717f01b74671050" kindref="member">~RenyiEntropy</ref>(){};</highlight></codeline>
<codeline lineno="38"><highlight class="normal"></highlight></codeline>
<codeline lineno="39" refid="classforpy_1_1_renyi_entropy_1ad4c96374febb4af75a8178fadfa80e2c" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">virtual</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/><ref refid="classforpy_1_1_renyi_entropy_1ad4c96374febb4af75a8178fadfa80e2c" kindref="member">operator()</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/>*class_members_numbers,</highlight></codeline>
<codeline lineno="40"><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/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>&amp;n,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/>&amp;fsum)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="41"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="classforpy_1_1_renyi_entropy_1a5d7ea08cb3ac0638fc4140dd9a515a37" kindref="member">q</ref><sp/>==<sp/>1.f)<sp/>{</highlight></codeline>
<codeline lineno="42"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classforpy_1_1_renyi_entropy_1a95126d5f1adcfe98440a6810c1719b98" kindref="member">shannon_entropy</ref>-&gt;operator()(class_members_numbers,<sp/>n,<sp/>fsum);</highlight></codeline>
<codeline lineno="43"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="classforpy_1_1_renyi_entropy_1a5d7ea08cb3ac0638fc4140dd9a515a37" kindref="member">q</ref><sp/>==<sp/>std::numeric_limits&lt;float&gt;::infinity())<sp/>{</highlight></codeline>
<codeline lineno="45"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-logf(</highlight></codeline>
<codeline lineno="46"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>-(<ref refid="classforpy_1_1_renyi_entropy_1a6434f0324833aa756d03baa88667b80d" kindref="member">classification_error</ref>-&gt;operator()(class_members_numbers,<sp/>n,<sp/>fsum)<sp/>-</highlight></codeline>
<codeline lineno="47"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>1.f));</highlight></codeline>
<codeline lineno="48"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="49"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>In<sp/>debug<sp/>mode,<sp/>run<sp/>checks.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="50"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="global_8h_1a7fbe72e39fae18e8a67a0cb688afd4be" kindref="member">FASSERT</ref>(static_cast&lt;float&gt;(std::accumulate(class_members_numbers,</highlight></codeline>
<codeline lineno="51"><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/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>class_members_numbers<sp/>+<sp/>n,</highlight></codeline>
<codeline lineno="52"><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/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>static_cast&lt;float&gt;(0)))<sp/>==<sp/>fsum);</highlight></codeline>
<codeline lineno="53"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Deal<sp/>with<sp/>the<sp/>special<sp/>case<sp/>quickly.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(fsum<sp/>==<sp/>0.f)<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0.f;</highlight></codeline>
<codeline lineno="55"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Cast<sp/>only<sp/>once<sp/>and<sp/>save<sp/>time.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="56"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/>entropy_sum<sp/>=<sp/>0.f;</highlight></codeline>
<codeline lineno="57"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/>quot;</highlight></codeline>
<codeline lineno="58"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ceilf(<ref refid="classforpy_1_1_renyi_entropy_1a5d7ea08cb3ac0638fc4140dd9a515a37" kindref="member">q</ref>)<sp/>==<sp/><ref refid="classforpy_1_1_renyi_entropy_1a5d7ea08cb3ac0638fc4140dd9a515a37" kindref="member">q</ref><sp/>||<sp/>floorf(<ref refid="classforpy_1_1_renyi_entropy_1a5d7ea08cb3ac0638fc4140dd9a515a37" kindref="member">q</ref>)<sp/>==<sp/><ref refid="classforpy_1_1_renyi_entropy_1a5d7ea08cb3ac0638fc4140dd9a515a37" kindref="member">q</ref>)<sp/>{</highlight></codeline>
<codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>q<sp/>is<sp/>a<sp/>whole<sp/>number.<sp/>Use<sp/>a<sp/>faster<sp/>implementation.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="namespaceforpy_1ad05e34c62859518b61b76b5085e913d8" kindref="member">uint</ref><sp/>whole_q<sp/>=<sp/></highlight><highlight class="keyword">static_cast&lt;</highlight><highlight class="normal"><ref refid="namespaceforpy_1ad05e34c62859518b61b76b5085e913d8" kindref="member">uint</ref></highlight><highlight class="keyword">&gt;</highlight><highlight class="normal">(<ref refid="classforpy_1_1_renyi_entropy_1a5d7ea08cb3ac0638fc4140dd9a515a37" kindref="member">q</ref>);</highlight></codeline>
<codeline lineno="61"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>n;<sp/>++i)<sp/>{</highlight></codeline>
<codeline lineno="62"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>quot<sp/>=<sp/>*(class_members_numbers++)<sp/>/<sp/>fsum;</highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>entropy_sum<sp/>+=<sp/><ref refid="namespaceforpy_1a1c0789b7bdd25c7469c20b29a84a77eb" kindref="member">fpowi</ref>(quot,<sp/>whole_q);</highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="65"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="66"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>p<sp/>is<sp/>not<sp/>a<sp/>whole<sp/>number.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Calculate.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>n;<sp/>++i)<sp/>{</highlight></codeline>
<codeline lineno="69"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>quot<sp/>=<sp/>*(class_members_numbers++)<sp/>/<sp/>fsum;</highlight></codeline>
<codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>entropy_sum<sp/>+=<sp/>powf(quot,<sp/><ref refid="classforpy_1_1_renyi_entropy_1a5d7ea08cb3ac0638fc4140dd9a515a37" kindref="member">q</ref>);</highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="72"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="73"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>logf(entropy_sum)<sp/>/<sp/>(1.f<sp/>-<sp/><ref refid="classforpy_1_1_renyi_entropy_1a5d7ea08cb3ac0638fc4140dd9a515a37" kindref="member">q</ref>);</highlight></codeline>
<codeline lineno="74"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="75"><highlight class="normal"></highlight></codeline>
<codeline lineno="76" refid="classforpy_1_1_renyi_entropy_1a6cd19bf8dab0a8ada1bcb1ab6a183b6e" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">friend</highlight><highlight class="normal"><sp/>std::ostream<sp/>&amp;<ref refid="classforpy_1_1_renyi_entropy_1a6cd19bf8dab0a8ada1bcb1ab6a183b6e" kindref="member">operator&lt;&lt;</ref>(std::ostream<sp/>&amp;stream,</highlight></codeline>
<codeline lineno="77"><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/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classforpy_1_1_renyi_entropy" kindref="compound">RenyiEntropy</ref><sp/>&amp;</highlight><highlight class="keyword">self</highlight><highlight class="normal">)<sp/>{</highlight></codeline>
<codeline lineno="78"><highlight class="normal"><sp/><sp/><sp/><sp/>stream<sp/>&lt;&lt;<sp/></highlight><highlight class="stringliteral">&quot;forpy::RenyiEntropy[alpha=&quot;</highlight><highlight class="normal"><sp/>&lt;&lt;<sp/></highlight><highlight class="keyword">self</highlight><highlight class="normal">.get_alpha()<sp/>&lt;&lt;<sp/></highlight><highlight class="stringliteral">&quot;]&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="79"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>stream;</highlight></codeline>
<codeline lineno="80"><highlight class="normal"><sp/><sp/>};</highlight></codeline>
<codeline lineno="81"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/><ref refid="classforpy_1_1_renyi_entropy_1add765381c1128b2288f42d4e4117e8fa" kindref="member">operator==</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classforpy_1_1_i_entropy_function" kindref="compound">IEntropyFunction</ref><sp/>&amp;rhs)<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="82"><highlight class="normal"></highlight></codeline>
<codeline lineno="84"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/><ref refid="classforpy_1_1_renyi_entropy_1abfdf05c835f395f882134f4854a17f63" kindref="member">get_alpha</ref>()<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="85"><highlight class="normal"></highlight></codeline>
<codeline lineno="86"><highlight class="normal"><sp/></highlight><highlight class="keyword">private</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="89" refid="classforpy_1_1_renyi_entropy_1a8b6aaf24605f1a3ac46c2b8601eae583" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"><sp/><ref refid="classforpy_1_1_renyi_entropy_1a8b6aaf24605f1a3ac46c2b8601eae583" kindref="member">RenyiEntropy</ref>(){};</highlight></codeline>
<codeline lineno="90"><highlight class="normal"></highlight></codeline>
<codeline lineno="91"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">friend</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">class<sp/></highlight><highlight class="normal">cereal::access;</highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/>&lt;</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>Archive&gt;</highlight></codeline>
<codeline lineno="93" refid="classforpy_1_1_renyi_entropy_1a742ad3779d726cf7999d3637f7207172" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classforpy_1_1_renyi_entropy_1a742ad3779d726cf7999d3637f7207172" kindref="member">serialize</ref>(Archive<sp/>&amp;ar,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="namespaceforpy_1ad05e34c62859518b61b76b5085e913d8" kindref="member">uint</ref><sp/>&amp;)<sp/>{</highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/>ar(cereal::make_nvp(</highlight><highlight class="stringliteral">&quot;base&quot;</highlight><highlight class="normal">,<sp/>cereal::base_class&lt;IEntropyFunction&gt;(</highlight><highlight class="keyword">this</highlight><highlight class="normal">)),</highlight></codeline>
<codeline lineno="95"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/>CEREAL_NVP(<ref refid="classforpy_1_1_renyi_entropy_1a5d7ea08cb3ac0638fc4140dd9a515a37" kindref="member">q</ref>),<sp/>CEREAL_NVP(<ref refid="classforpy_1_1_renyi_entropy_1a95126d5f1adcfe98440a6810c1719b98" kindref="member">shannon_entropy</ref>),<sp/>CEREAL_NVP(<ref refid="classforpy_1_1_renyi_entropy_1a0584da34af0c36c89f41bff92255fb63" kindref="member">induced_p</ref>),</highlight></codeline>
<codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/>CEREAL_NVP(<ref refid="classforpy_1_1_renyi_entropy_1a6434f0324833aa756d03baa88667b80d" kindref="member">classification_error</ref>));</highlight></codeline>
<codeline lineno="97" refid="classforpy_1_1_renyi_entropy_1a5d7ea08cb3ac0638fc4140dd9a515a37" refkind="member"><highlight class="normal"><sp/><sp/>};</highlight></codeline>
<codeline lineno="98"><highlight class="normal"></highlight></codeline>
<codeline lineno="99"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/><ref refid="classforpy_1_1_renyi_entropy_1a5d7ea08cb3ac0638fc4140dd9a515a37" kindref="member">q</ref>;</highlight></codeline>
<codeline lineno="100" refid="classforpy_1_1_renyi_entropy_1a95126d5f1adcfe98440a6810c1719b98" refkind="member"><highlight class="normal"><sp/><sp/>std::unique_ptr&lt;ShannonEntropy&gt;<sp/><ref refid="classforpy_1_1_renyi_entropy_1a95126d5f1adcfe98440a6810c1719b98" kindref="member">shannon_entropy</ref>;</highlight></codeline>
<codeline lineno="101" refid="classforpy_1_1_renyi_entropy_1a0584da34af0c36c89f41bff92255fb63" refkind="member"><highlight class="normal"><sp/><sp/>std::unique_ptr&lt;InducedEntropy&gt;<sp/><ref refid="classforpy_1_1_renyi_entropy_1a0584da34af0c36c89f41bff92255fb63" kindref="member">induced_p</ref>;</highlight></codeline>
<codeline lineno="102" refid="classforpy_1_1_renyi_entropy_1a6434f0324833aa756d03baa88667b80d" refkind="member"><highlight class="normal"><sp/><sp/>std::unique_ptr&lt;ClassificationError&gt;<sp/><ref refid="classforpy_1_1_renyi_entropy_1a6434f0324833aa756d03baa88667b80d" kindref="member">classification_error</ref>;</highlight></codeline>
<codeline lineno="103"><highlight class="normal"><sp/><sp/><ref refid="classforpy_1_1_renyi_entropy_1a68af460eda21fef13f4f65c8173333c3" kindref="member">DISALLOW_COPY_AND_ASSIGN</ref>(<ref refid="classforpy_1_1_renyi_entropy" kindref="compound">RenyiEntropy</ref>);</highlight></codeline>
<codeline lineno="104"><highlight class="normal">};</highlight></codeline>
<codeline lineno="105"><highlight class="normal">}<sp/><sp/></highlight><highlight class="comment">//<sp/>namespace<sp/>forpy</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="106"><highlight class="normal"></highlight></codeline>
<codeline lineno="107"><highlight class="normal"><ref refid="renyientropy_8h_1a495cbd69d753bf61fc9a3dbda76a5155" kindref="member">CEREAL_REGISTER_TYPE</ref>(<ref refid="classforpy_1_1_renyi_entropy" kindref="compound">forpy::RenyiEntropy</ref>);</highlight></codeline>
<codeline lineno="108"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/><sp/>//<sp/>FORPY_IMPURITIES_RENYIENTROPY_H_</highlight></codeline>
    </programlisting>
    <location file="/Users/classner/git/forpy/include/forpy/impurities/renyientropy.h"/>
  </compounddef>
</doxygen>
