121 lines
21 KiB
HTML
121 lines
21 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.11"/>
|
|
<title>mlpack: src/mlpack/prereqs.hpp Source File</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<script type="text/javascript">
|
|
$(document).ready(function() { init_search(); });
|
|
</script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
<link href="extra-stylesheet.css" rel="stylesheet" type="text/css"/>
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">mlpack
|
|
 <span id="projectnumber">master</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.11 -->
|
|
<script type="text/javascript">
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
</script>
|
|
<div id="navrow1" class="tabs">
|
|
<ul class="tablist">
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
|
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
|
<li>
|
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
|
<span class="left">
|
|
<img id="MSearchSelect" src="search/mag_sel.png"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
alt=""/>
|
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
|
</span><span class="right">
|
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
|
</span>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div id="navrow2" class="tabs2">
|
|
<ul class="tablist">
|
|
<li><a href="files.html"><span>File List</span></a></li>
|
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_44a936ef30fc126706c6284a2fc0c990.html">mlpack</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">prereqs.hpp</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<a href="prereqs_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="preprocessor">#ifndef MLPACK_PREREQS_HPP</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="preprocessor">#define MLPACK_PREREQS_HPP</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> </div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">// Defining _USE_MATH_DEFINES should set M_PI.</span></div><div class="line"><a name="l00015"></a><span class="lineno"><a class="line" href="prereqs_8hpp.html#a525335710b53cb064ca56b936120431e"> 15</a></span> <span class="preprocessor">#define _USE_MATH_DEFINES</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="preprocessor">#include <cmath></span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> </div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment">// First, check if Armadillo was included before, warning if so.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#ifdef ARMA_INCLUDES</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#pragma message "Armadillo was included before mlpack; this can sometimes cause\</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor"> problems. It should only be necessary to include <mlpack/core.hpp> and not \</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor"><armadillo>."</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="comment">// Next, standard includes.</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include <cstdlib></span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include <cstdio></span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include <cstring></span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include <cctype></span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include <climits></span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor">#include <cfloat></span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#include <cstdint></span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor">#include <iostream></span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor">#include <stdexcept></span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="preprocessor">#include <tuple></span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="preprocessor">#include <queue></span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> </div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment">// But if it's not defined, we'll do it.</span></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="preprocessor">#ifndef M_PI</span></div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="prereqs_8hpp.html#ae71449b1cc6e6250b91f539153a7a0d3"> 40</a></span> <span class="preprocessor"> #define M_PI 3.141592653589793238462643383279</span></div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> </div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="comment">// Give ourselves a nice way to force functions to be inline if we need.</span></div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="prereqs_8hpp.html#ae8c57c7218a376f10cbdf0e50f1189ee"> 44</a></span> <span class="preprocessor">#define force_inline</span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="preprocessor">#if defined(__GNUG__) && !defined(DEBUG)</span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="preprocessor"> #undef force_inline</span></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="preprocessor"> #define force_inline __attribute__((always_inline))</span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="preprocessor">#elif defined(_MSC_VER) && !defined(DEBUG)</span></div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <span class="preprocessor"> #undef force_inline</span></div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <span class="preprocessor"> #define force_inline __forceinline</span></div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span> </div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span> <span class="comment">// Backport this functionality from C++14, if it doesn't exist.</span></div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="preprocessor">#if __cplusplus <= 201103L</span></div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="preprocessor">#if !defined(_MSC_VER) || _MSC_VER <= 1800</span></div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="namespacestd.html"> 56</a></span> <span class="keyword">namespace </span><a class="code" href="namespacestd.html">std</a> {</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> </div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="keyword">template</span><<span class="keywordtype">bool</span> B, <span class="keyword">class</span> T = <span class="keywordtype">void</span>></div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="namespacestd.html#ac774dbdf8ae769197167b2a8273462fc"> 59</a></span> <span class="keyword">using</span> <a class="code" href="namespacestd.html#ac774dbdf8ae769197167b2a8273462fc">enable_if_t</a> = <span class="keyword">typename</span> enable_if<B, T>::type;</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> </div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> }</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span> </div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="comment">// Increase the number of template arguments for the boost list class.</span></div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="preprocessor">#undef BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS</span></div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> <span class="preprocessor">#undef BOOST_MPL_LIMIT_LIST_SIZE</span></div><div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="prereqs_8hpp.html#a5cfc0a80bcb9c742a4dd13252e8e70b2"> 68</a></span> <span class="preprocessor">#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS</span></div><div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="prereqs_8hpp.html#acba1425c4e8d651fd058a07735044b3e"> 69</a></span> <span class="preprocessor">#define BOOST_MPL_LIMIT_LIST_SIZE 40</span></div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span> </div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="comment">// We'll need the necessary boost::serialization features, as well as what we</span></div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="comment">// use with mlpack. In Boost 1.59 and newer, the BOOST_PFTO code is no longer</span></div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span> <span class="comment">// defined, but we still need to define it (as nothing) so that the mlpack</span></div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> <span class="comment">// serialization shim compiles.</span></div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span> <span class="preprocessor">#include <boost/serialization/serialization.hpp></span></div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span> <span class="preprocessor">#include <boost/serialization/vector.hpp></span></div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span> <span class="preprocessor">#include <boost/serialization/map.hpp></span></div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span> <span class="comment">// boost_backport.hpp handles the version and backporting of serialization (and</span></div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span> <span class="comment">// other) features.</span></div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span> <span class="preprocessor">#include "mlpack/core/boost_backport/boost_backport_serialization.hpp"</span></div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span> <span class="comment">// Boost 1.59 and newer don't use BOOST_PFTO, but our shims do. We can resolve</span></div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="comment">// any issue by setting BOOST_PFTO to nothing.</span></div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span> <span class="preprocessor">#ifndef BOOST_PFTO</span></div><div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="prereqs_8hpp.html#af7bb2c3c080a4be494e2e685c3a3f249"> 84</a></span> <span class="preprocessor"> #define BOOST_PFTO</span></div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span> <span class="preprocessor">#include <<a class="code" href="serialization__shim_8hpp.html">mlpack/core/data/serialization_shim.hpp</a>></span></div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span> <span class="preprocessor">#include <<a class="code" href="serialization__template__version_8hpp.html">mlpack/core/data/serialization_template_version.hpp</a>></span></div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span> </div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span> <span class="comment">// Now include Armadillo through the special mlpack extensions.</span></div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span> <span class="preprocessor">#include <mlpack/core/arma_extend/arma_extend.hpp></span></div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span> <span class="preprocessor">#include <<a class="code" href="arma__traits_8hpp.html">mlpack/core/util/arma_traits.hpp</a>></span></div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span> </div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span> <span class="comment">// Ensure that the user isn't doing something stupid with their Armadillo</span></div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span> <span class="comment">// defines.</span></div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span> <span class="preprocessor">#include <<a class="code" href="arma__config__check_8hpp.html">mlpack/core/util/arma_config_check.hpp</a>></span></div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span> </div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span> <span class="comment">// All code should have access to logging.</span></div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span> <span class="preprocessor">#include <<a class="code" href="log_8hpp.html">mlpack/core/util/log.hpp</a>></span></div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span> <span class="preprocessor">#include <<a class="code" href="timers_8hpp.html">mlpack/core/util/timers.hpp</a>></span></div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span> </div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span> <span class="comment">// On Visual Studio, disable C4519 (default arguments for function templates)</span></div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span> <span class="comment">// since it's by default an error, which doesn't even make any sense because</span></div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span> <span class="comment">// it's part of the C++11 standard.</span></div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span> <span class="preprocessor">#ifdef _MSC_VER</span></div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span> <span class="preprocessor"> #pragma warning(disable : 4519)</span></div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span> <span class="preprocessor"> #define ARMA_USE_CXX11</span></div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span> </div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span> <span class="comment">// We need to be able to mark functions deprecated.</span></div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span> <span class="preprocessor">#include <<a class="code" href="deprecated_8hpp.html">mlpack/core/util/deprecated.hpp</a>></span></div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span> </div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span> <span class="preprocessor">#endif</span></div><div class="ttc" id="deprecated_8hpp_html"><div class="ttname"><a href="deprecated_8hpp.html">deprecated.hpp</a></div></div>
|
|
<div class="ttc" id="namespacestd_html"><div class="ttname"><a href="namespacestd.html">std</a></div><div class="ttdef"><b>Definition:</b> <a href="prereqs_8hpp_source.html#l00056">prereqs.hpp:56</a></div></div>
|
|
<div class="ttc" id="serialization__template__version_8hpp_html"><div class="ttname"><a href="serialization__template__version_8hpp.html">serialization_template_version.hpp</a></div></div>
|
|
<div class="ttc" id="serialization__shim_8hpp_html"><div class="ttname"><a href="serialization__shim_8hpp.html">serialization_shim.hpp</a></div></div>
|
|
<div class="ttc" id="log_8hpp_html"><div class="ttname"><a href="log_8hpp.html">log.hpp</a></div></div>
|
|
<div class="ttc" id="arma__config__check_8hpp_html"><div class="ttname"><a href="arma__config__check_8hpp.html">arma_config_check.hpp</a></div></div>
|
|
<div class="ttc" id="arma__traits_8hpp_html"><div class="ttname"><a href="arma__traits_8hpp.html">arma_traits.hpp</a></div></div>
|
|
<div class="ttc" id="timers_8hpp_html"><div class="ttname"><a href="timers_8hpp.html">timers.hpp</a></div></div>
|
|
<div class="ttc" id="namespacestd_html_ac774dbdf8ae769197167b2a8273462fc"><div class="ttname"><a href="namespacestd.html#ac774dbdf8ae769197167b2a8273462fc">std::enable_if_t</a></div><div class="ttdeci">typename enable_if< B, T >::type enable_if_t</div><div class="ttdef"><b>Definition:</b> <a href="prereqs_8hpp_source.html#l00059">prereqs.hpp:59</a></div></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.11
|
|
</small></address>
|
|
</body>
|
|
<script type="text/javascript">
|
|
var x = document.getElementsByClassName("formulaDsp");
|
|
var i;
|
|
for (i = 0; i < x.length; i++)
|
|
{
|
|
x[i].width /= 4;
|
|
}
|
|
</script>
|
|
</html>
|