Added Doxygen docs
This commit is contained in:
301
docs/xml/_source_8cpp.xml
Normal file
301
docs/xml/_source_8cpp.xml
Normal file
@ -0,0 +1,301 @@
|
||||
<?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.9.8" xml:lang="en-US">
|
||||
<compounddef id="_source_8cpp" kind="file" language="C++">
|
||||
<compoundname>Source.cpp</compoundname>
|
||||
<includes local="no">iostream</includes>
|
||||
<includes local="no">chrono</includes>
|
||||
<includes local="no">thread</includes>
|
||||
<includes local="no">mutex</includes>
|
||||
<includes refid="_exponential_8h" local="yes">Exponential.h</includes>
|
||||
<includes local="yes">Timer.h</includes>
|
||||
<incdepgraph>
|
||||
<node id="6">
|
||||
<label>Exponential.h</label>
|
||||
<link refid="_exponential_8h_source"/>
|
||||
<childnode refid="7" relation="include">
|
||||
</childnode>
|
||||
<childnode refid="8" relation="include">
|
||||
</childnode>
|
||||
<childnode refid="9" relation="include">
|
||||
</childnode>
|
||||
<childnode refid="10" relation="include">
|
||||
</childnode>
|
||||
<childnode refid="11" relation="include">
|
||||
</childnode>
|
||||
<childnode refid="12" relation="include">
|
||||
</childnode>
|
||||
<childnode refid="13" relation="include">
|
||||
</childnode>
|
||||
</node>
|
||||
<node id="1">
|
||||
<label>Exponential/Source.cpp</label>
|
||||
<link refid="_source_8cpp"/>
|
||||
<childnode refid="2" relation="include">
|
||||
</childnode>
|
||||
<childnode refid="3" relation="include">
|
||||
</childnode>
|
||||
<childnode refid="4" relation="include">
|
||||
</childnode>
|
||||
<childnode refid="5" relation="include">
|
||||
</childnode>
|
||||
<childnode refid="6" relation="include">
|
||||
</childnode>
|
||||
<childnode refid="14" relation="include">
|
||||
</childnode>
|
||||
</node>
|
||||
<node id="14">
|
||||
<label>Timer.h</label>
|
||||
</node>
|
||||
<node id="11">
|
||||
<label>algorithm</label>
|
||||
</node>
|
||||
<node id="3">
|
||||
<label>chrono</label>
|
||||
</node>
|
||||
<node id="13">
|
||||
<label>exception</label>
|
||||
</node>
|
||||
<node id="12">
|
||||
<label>execution</label>
|
||||
</node>
|
||||
<node id="9">
|
||||
<label>float.h</label>
|
||||
</node>
|
||||
<node id="2">
|
||||
<label>iostream</label>
|
||||
</node>
|
||||
<node id="5">
|
||||
<label>mutex</label>
|
||||
</node>
|
||||
<node id="7">
|
||||
<label>ostream</label>
|
||||
</node>
|
||||
<node id="10">
|
||||
<label>random</label>
|
||||
</node>
|
||||
<node id="4">
|
||||
<label>thread</label>
|
||||
</node>
|
||||
<node id="8">
|
||||
<label>vector</label>
|
||||
</node>
|
||||
</incdepgraph>
|
||||
<sectiondef kind="typedef">
|
||||
<memberdef kind="typedef" id="_source_8cpp_1a58886021157a65d2d4b9c3f486ea5c2c" prot="public" static="no">
|
||||
<templateparamlist>
|
||||
<param>
|
||||
<type><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">int</ref></type>
|
||||
<declname>n</declname>
|
||||
<defname>n</defname>
|
||||
</param>
|
||||
</templateparamlist>
|
||||
<type><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">EXPONENTIAL::Function</ref>< <ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">n</ref> ></type>
|
||||
<definition>using Function = EXPONENTIAL::Function<n></definition>
|
||||
<argsstring></argsstring>
|
||||
<name>Function</name>
|
||||
<briefdescription>
|
||||
</briefdescription>
|
||||
<detaileddescription>
|
||||
</detaileddescription>
|
||||
<inbodydescription>
|
||||
</inbodydescription>
|
||||
<location file="Exponential/Source.cpp" line="11" column="1" bodyfile="Exponential/Source.cpp" bodystart="11" bodyend="-1"/>
|
||||
</memberdef>
|
||||
<memberdef kind="typedef" id="_source_8cpp_1abdf3aa0505635f2b960799972f78977d" prot="public" static="no">
|
||||
<type>TIMER::Timer</type>
|
||||
<definition>typedef TIMER::Timer timer</definition>
|
||||
<argsstring></argsstring>
|
||||
<name>timer</name>
|
||||
<briefdescription>
|
||||
</briefdescription>
|
||||
<detaileddescription>
|
||||
</detaileddescription>
|
||||
<inbodydescription>
|
||||
</inbodydescription>
|
||||
<location file="Exponential/Source.cpp" line="13" column="22" bodyfile="Exponential/Source.cpp" bodystart="13" bodyend="-1"/>
|
||||
</memberdef>
|
||||
</sectiondef>
|
||||
<sectiondef kind="func">
|
||||
<memberdef kind="function" id="_source_8cpp_1aaffba5622da3efcab3ef60638c23cd52" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
|
||||
<templateparamlist>
|
||||
<param>
|
||||
<type><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">int</ref></type>
|
||||
<declname>exp</declname>
|
||||
<defname>exp</defname>
|
||||
</param>
|
||||
</templateparamlist>
|
||||
<type><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">void</ref></type>
|
||||
<definition>void CalcRoots</definition>
|
||||
<argsstring>(std::mutex &m, const Function< exp > &func, EXPONENTIAL::GA_Options options)</argsstring>
|
||||
<name>CalcRoots</name>
|
||||
<param>
|
||||
<type>std::mutex &</type>
|
||||
<declname>m</declname>
|
||||
</param>
|
||||
<param>
|
||||
<type><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">const</ref> <ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">Function</ref>< <ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">exp</ref> > &</type>
|
||||
<declname>func</declname>
|
||||
</param>
|
||||
<param>
|
||||
<type><ref refid="struct_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_g_a___options" kindref="compound">EXPONENTIAL::GA_Options</ref></type>
|
||||
<declname>options</declname>
|
||||
</param>
|
||||
<briefdescription>
|
||||
</briefdescription>
|
||||
<detaileddescription>
|
||||
</detaileddescription>
|
||||
<inbodydescription>
|
||||
</inbodydescription>
|
||||
<location file="Exponential/Source.cpp" line="16" column="6" bodyfile="Exponential/Source.cpp" bodystart="16" bodyend="34"/>
|
||||
</memberdef>
|
||||
<memberdef kind="function" id="_source_8cpp_1aea271c738ee176b86ab545bac23336f6" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
|
||||
<templateparamlist>
|
||||
<param>
|
||||
<type><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">int</ref></type>
|
||||
<declname>exp</declname>
|
||||
<defname>exp</defname>
|
||||
</param>
|
||||
</templateparamlist>
|
||||
<type><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">void</ref></type>
|
||||
<definition>void SolveX</definition>
|
||||
<argsstring>(std::mutex &m, const Function< exp > &func, EXPONENTIAL::GA_Options options, const double &y)</argsstring>
|
||||
<name>SolveX</name>
|
||||
<param>
|
||||
<type>std::mutex &</type>
|
||||
<declname>m</declname>
|
||||
</param>
|
||||
<param>
|
||||
<type><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">const</ref> <ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">Function</ref>< <ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">exp</ref> > &</type>
|
||||
<declname>func</declname>
|
||||
</param>
|
||||
<param>
|
||||
<type><ref refid="struct_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_g_a___options" kindref="compound">EXPONENTIAL::GA_Options</ref></type>
|
||||
<declname>options</declname>
|
||||
</param>
|
||||
<param>
|
||||
<type><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">const</ref> <ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">double</ref> &</type>
|
||||
<declname>y</declname>
|
||||
</param>
|
||||
<briefdescription>
|
||||
</briefdescription>
|
||||
<detaileddescription>
|
||||
</detaileddescription>
|
||||
<inbodydescription>
|
||||
</inbodydescription>
|
||||
<location file="Exponential/Source.cpp" line="37" column="6" bodyfile="Exponential/Source.cpp" bodystart="37" bodyend="51"/>
|
||||
</memberdef>
|
||||
<memberdef kind="function" id="_source_8cpp_1ae66f6b31b5ad750f1fe042a706a4e3d4" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
|
||||
<type><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">int</ref></type>
|
||||
<definition>int main</definition>
|
||||
<argsstring>()</argsstring>
|
||||
<name>main</name>
|
||||
<briefdescription>
|
||||
</briefdescription>
|
||||
<detaileddescription>
|
||||
</detaileddescription>
|
||||
<inbodydescription>
|
||||
</inbodydescription>
|
||||
<location file="Exponential/Source.cpp" line="53" column="5" bodyfile="Exponential/Source.cpp" bodystart="53" bodyend="92"/>
|
||||
</memberdef>
|
||||
</sectiondef>
|
||||
<briefdescription>
|
||||
</briefdescription>
|
||||
<detaileddescription>
|
||||
</detaileddescription>
|
||||
<programlisting>
|
||||
<codeline lineno="1"><highlight class="preprocessor">#include<sp/><iostream></highlight><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="2"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><chrono></highlight><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="3"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><thread></highlight><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="4"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><mutex></highlight><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="5"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>"Exponential.h"</highlight><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="6"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>"Timer.h"</highlight><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="7"><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="8"><highlight class="normal"></highlight><highlight class="keyword">using<sp/>namespace<sp/></highlight><highlight class="normal">JRAMPERSAD;</highlight></codeline>
|
||||
<codeline lineno="9"><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="10"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n></highlight></codeline>
|
||||
<codeline lineno="11"><highlight class="normal"></highlight><highlight class="keyword">using<sp/></highlight><highlight class="normal"><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">Function</ref><sp/>=<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">EXPONENTIAL::Function<n></ref>;</highlight></codeline>
|
||||
<codeline lineno="12"><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="13"><highlight class="normal"></highlight><highlight class="keyword">typedef</highlight><highlight class="normal"><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function_1a0585614da72409acfbed262411ea7882" kindref="member">TIMER::Timer</ref><sp/>timer;</highlight></codeline>
|
||||
<codeline lineno="14"><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="15"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>exp></highlight></codeline>
|
||||
<codeline lineno="16"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>CalcRoots(<ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function_1a0585614da72409acfbed262411ea7882" kindref="member">std::mutex</ref>&<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">m</ref>,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">Function<exp></ref>&<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">func</ref>,<sp/><ref refid="struct_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_g_a___options" kindref="compound">EXPONENTIAL::GA_Options</ref><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">options</ref>)</highlight></codeline>
|
||||
<codeline lineno="17"><highlight class="normal">{</highlight></codeline>
|
||||
<codeline lineno="18"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">m</ref>.lock();</highlight></codeline>
|
||||
<codeline lineno="19"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function_1a0585614da72409acfbed262411ea7882" kindref="member">std::cout</ref><sp/><<<sp/></highlight><highlight class="stringliteral">"Starting<sp/>calculation...\n"</highlight><highlight class="normal">;</highlight></codeline>
|
||||
<codeline lineno="20"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">m</ref>.unlock();</highlight></codeline>
|
||||
<codeline lineno="21"><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="22"><highlight class="normal"><sp/><sp/><sp/><sp/>timer<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">t</ref>;</highlight></codeline>
|
||||
<codeline lineno="23"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">auto</highlight><highlight class="normal"><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">gr</ref><sp/>=<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">func</ref>.<ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function_1ad090de9f6636094f14f1279615fccbc0" kindref="member">get_real_roots</ref>(<ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">options</ref>);</highlight></codeline>
|
||||
<codeline lineno="24"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">t</ref>.SetEnd();</highlight></codeline>
|
||||
<codeline lineno="25"><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="26"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">m</ref>.lock();</highlight></codeline>
|
||||
<codeline lineno="27"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function_1a0585614da72409acfbed262411ea7882" kindref="member">std::cout</ref><sp/><<<sp/></highlight><highlight class="stringliteral">"Time<sp/>took<sp/>to<sp/>calculate<sp/>approx<sp/>root<sp/>values:<sp/>"</highlight><highlight class="normal"><sp/><<<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">t</ref>.GetTimeInS()<sp/><<<sp/></highlight><highlight class="stringliteral">"s\n"</highlight><highlight class="normal">;</highlight></codeline>
|
||||
<codeline lineno="28"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function_1a0585614da72409acfbed262411ea7882" kindref="member">std::cout</ref><sp/><<<sp/></highlight><highlight class="stringliteral">"Approximate<sp/>values<sp/>of<sp/>x<sp/>where<sp/>y<sp/>=<sp/>0<sp/>are:<sp/>\n"</highlight><highlight class="normal">;</highlight></codeline>
|
||||
<codeline lineno="29"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function_1a0585614da72409acfbed262411ea7882" kindref="member">std::for_each</ref>(<ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">gr</ref>.begin(),<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">gr</ref>.end(),</highlight></codeline>
|
||||
<codeline lineno="30"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>[](</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">auto</highlight><highlight class="normal">&<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">val</ref>)<sp/>{</highlight></codeline>
|
||||
<codeline lineno="31"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>std::cout<sp/><<<sp/></highlight><highlight class="stringliteral">"x:"</highlight><highlight class="normal"><sp/><<<sp/>val<sp/><<<sp/></highlight><highlight class="stringliteral">'\n'</highlight><highlight class="normal">;</highlight></codeline>
|
||||
<codeline lineno="32"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>});</highlight></codeline>
|
||||
<codeline lineno="33"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">m</ref>.unlock();</highlight></codeline>
|
||||
<codeline lineno="34"><highlight class="normal">}</highlight></codeline>
|
||||
<codeline lineno="35"><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="36"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>exp></highlight></codeline>
|
||||
<codeline lineno="37"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>SolveX(<ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function_1a0585614da72409acfbed262411ea7882" kindref="member">std::mutex</ref>&<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">m</ref>,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">Function<exp></ref>&<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">func</ref>,<sp/><ref refid="struct_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_g_a___options" kindref="compound">EXPONENTIAL::GA_Options</ref><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">options</ref>,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal">&<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">y</ref>)</highlight></codeline>
|
||||
<codeline lineno="38"><highlight class="normal">{</highlight></codeline>
|
||||
<codeline lineno="39"><highlight class="normal"><sp/><sp/><sp/><sp/>timer<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">t</ref>;</highlight></codeline>
|
||||
<codeline lineno="40"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">auto</highlight><highlight class="normal"><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">res</ref><sp/>=<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">func</ref>.<ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function_1a46b9671c4a29b2b2b34586048a3b795a" kindref="member">solve_x</ref>(<ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">y</ref>,<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">options</ref>);</highlight></codeline>
|
||||
<codeline lineno="41"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">t</ref>.SetEnd();</highlight></codeline>
|
||||
<codeline lineno="42"><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="43"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">m</ref>.lock();</highlight></codeline>
|
||||
<codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function_1a0585614da72409acfbed262411ea7882" kindref="member">std::cout</ref><sp/><<<sp/></highlight><highlight class="stringliteral">"Time<sp/>took<sp/>to<sp/>calculate<sp/>approx<sp/>x<sp/>values:<sp/>"</highlight><highlight class="normal"><sp/><<<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">t</ref>.GetTimeInS()<sp/><<<sp/></highlight><highlight class="stringliteral">"s\n"</highlight><highlight class="normal">;</highlight></codeline>
|
||||
<codeline lineno="45"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function_1a0585614da72409acfbed262411ea7882" kindref="member">std::cout</ref><sp/><<<sp/></highlight><highlight class="stringliteral">"Approximate<sp/>values<sp/>of<sp/>x<sp/>where<sp/>y<sp/>=<sp/>"</highlight><highlight class="normal"><sp/><<<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">y</ref><sp/><<<sp/></highlight><highlight class="stringliteral">"<sp/>are:<sp/>\n"</highlight><highlight class="normal">;</highlight></codeline>
|
||||
<codeline lineno="46"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function_1a0585614da72409acfbed262411ea7882" kindref="member">std::for_each</ref>(<ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">res</ref>.begin(),<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">res</ref>.end(),</highlight></codeline>
|
||||
<codeline lineno="47"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>[](</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">auto</highlight><highlight class="normal">&<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">val</ref>)<sp/>{</highlight></codeline>
|
||||
<codeline lineno="48"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>std::cout<sp/><<<sp/></highlight><highlight class="stringliteral">"x:"</highlight><highlight class="normal"><sp/><<<sp/>val<sp/><<<sp/></highlight><highlight class="stringliteral">'\n'</highlight><highlight class="normal">;</highlight></codeline>
|
||||
<codeline lineno="49"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>});</highlight></codeline>
|
||||
<codeline lineno="50"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">m</ref>.unlock();</highlight></codeline>
|
||||
<codeline lineno="51"><highlight class="normal">}</highlight></codeline>
|
||||
<codeline lineno="52"><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="53"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>main()</highlight></codeline>
|
||||
<codeline lineno="54"><highlight class="normal">{</highlight></codeline>
|
||||
<codeline lineno="55"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function_1a0585614da72409acfbed262411ea7882" kindref="member">std::vector<int></ref><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">vec</ref>{<sp/>1,<sp/>5,<sp/>4<sp/>};</highlight></codeline>
|
||||
<codeline lineno="56"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">Function<2></ref><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">f</ref>{<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">vec</ref><sp/>};</highlight></codeline>
|
||||
<codeline lineno="57"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">Function<3></ref><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">g</ref>{<sp/>{<sp/>1,<sp/>-6,<sp/>11,<sp/>-6<sp/>}<sp/>};</highlight></codeline>
|
||||
<codeline lineno="58"><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="struct_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_g_a___options" kindref="compound">EXPONENTIAL::GA_Options</ref><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">options</ref>;</highlight></codeline>
|
||||
<codeline lineno="60"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">options</ref>.mutation_percentage<sp/>=<sp/>0.005;</highlight></codeline>
|
||||
<codeline lineno="61"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">options</ref>.num_of_generations<sp/>=<sp/>10;</highlight></codeline>
|
||||
<codeline lineno="62"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">options</ref>.sample_size<sp/>=<sp/>50;</highlight></codeline>
|
||||
<codeline lineno="63"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">options</ref>.data_size<sp/>=<sp/>5000000;</highlight></codeline>
|
||||
<codeline lineno="64"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">options</ref>.min_range<sp/>=<sp/>-100;</highlight></codeline>
|
||||
<codeline lineno="65"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">options</ref>.max_range<sp/>=<sp/>100;</highlight></codeline>
|
||||
<codeline lineno="66"><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function_1a0585614da72409acfbed262411ea7882" kindref="member">std::mutex</ref><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">m</ref>;</highlight></codeline>
|
||||
<codeline lineno="68"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function_1a0585614da72409acfbed262411ea7882" kindref="member">std::thread</ref><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">th</ref>(<ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">CalcRoots<3></ref>,<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function_1a0585614da72409acfbed262411ea7882" kindref="member">std::ref</ref>(<ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">m</ref>),<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function_1a0585614da72409acfbed262411ea7882" kindref="member">std::cref</ref>(<ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">g</ref>),<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">options</ref>);</highlight></codeline>
|
||||
<codeline lineno="69"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//std::thread<sp/>th1(SolveX<3>,<sp/>std::ref(m),<sp/>std::cref(g),<sp/>options,<sp/>5);</highlight><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//std::thread<sp/>th2(SolveX<3>,<sp/>std::ref(m),<sp/>std::cref(g),<sp/>options,<sp/>23);</highlight><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="71"><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="72"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//CalcRoots<3>(m,<sp/>g);</highlight><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="73"><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="74"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">m</ref>.lock();</highlight></codeline>
|
||||
<codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function_1a0585614da72409acfbed262411ea7882" kindref="member">std::cout</ref><sp/><<<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">g</ref><sp/><<<sp/></highlight><highlight class="stringliteral">"<sp/>when<sp/>x<sp/>=<sp/>4.961015\n"</highlight><highlight class="normal"><sp/><<<sp/></highlight><highlight class="stringliteral">"y<sp/>=<sp/>"</highlight><highlight class="normal"><sp/><<<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">g</ref>.<ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function_1a5464547daff0c43faccdc40ea480bab4" kindref="member">solve_y</ref>(4.961015)<sp/><<<sp/></highlight><highlight class="stringliteral">"\n\n"</highlight><highlight class="normal">;</highlight></codeline>
|
||||
<codeline lineno="76"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//std::cout<sp/><<<sp/>g<sp/><<<sp/>"<sp/>when<sp/>x<sp/>=<sp/>4.30891\n"<sp/><<<sp/>"y<sp/>=<sp/>"<sp/><<<sp/>g.solve_y(4.30891)<sp/><<<sp/>"\n\n";</highlight><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="77"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//std::cout<sp/><<<sp/>g<sp/><<<sp/>"<sp/>when<sp/>x<sp/>=<sp/>2\n"<sp/><<<sp/>"y<sp/>=<sp/>"<sp/><<<sp/>g.solve_y(2)<sp/><<<sp/>"\n\n";</highlight><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="78"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//std::cout<sp/><<<sp/>g<sp/><<<sp/>"<sp/>when<sp/>x<sp/>=<sp/>3\n"<sp/><<<sp/>"y<sp/>=<sp/>"<sp/><<<sp/>g.solve_y(3)<sp/><<<sp/>"\n\n";</highlight><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="79"><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="80"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//std::cout<sp/><<<sp/>"Median:<sp/>"<sp/><<<sp/>MATH::MEDIAN(gr)<sp/><<<sp/>'\n';</highlight><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="81"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//std::cout<sp/><<<sp/>"Mean:<sp/>"<sp/><<<sp/>MATH::MEAN(gr)<sp/><<<sp/>'\n';</highlight><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="82"><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="83"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//std::cout<sp/><<<sp/>"Calculating<sp/>Roots<sp/>for<sp/>function<sp/>f(x)<sp/>=<sp/>"<sp/><<<sp/>g<sp/><<<sp/>'\n';</highlight><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="84"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//std::cout<sp/><<<sp/>"The<sp/>y-intercept<sp/>of<sp/>the<sp/>function<sp/>f(x)<sp/>is<sp/>"<sp/><<<sp/>g.solve_y(0)<sp/><<<sp/>'\n';</highlight><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="85"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function_1a0585614da72409acfbed262411ea7882" kindref="member">std::cout</ref><sp/><<<sp/></highlight><highlight class="stringliteral">"dy/dx<sp/>of<sp/>f(x)<sp/>is<sp/>"</highlight><highlight class="normal"><sp/><<<sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">g</ref>.<ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function_1ae43c705b427ac1ef27aed061a63e500e" kindref="member">differential</ref>()<sp/><<<sp/></highlight><highlight class="charliteral">'\n'</highlight><highlight class="normal">;</highlight></codeline>
|
||||
<codeline lineno="86"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">m</ref>.unlock();</highlight></codeline>
|
||||
<codeline lineno="87"><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="88"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="class_j_r_a_m_p_e_r_s_a_d_1_1_e_x_p_o_n_e_n_t_i_a_l_1_1_function" kindref="compound">th</ref>.join();</highlight></codeline>
|
||||
<codeline lineno="89"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//th1.join();</highlight><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="90"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//th2.join();</highlight><highlight class="normal"></highlight></codeline>
|
||||
<codeline lineno="91"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
|
||||
<codeline lineno="92"><highlight class="normal">}</highlight></codeline>
|
||||
</programlisting>
|
||||
<location file="Exponential/Source.cpp"/>
|
||||
</compounddef>
|
||||
</doxygen>
|
Reference in New Issue
Block a user