Project-4/docs/testlib_8hpp.html
2023-11-21 11:27:34 +01:00

253 lines
12 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>2 Dimensional Ising Model: include/testlib.hpp File Reference</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="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.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/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.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 id="projectrow">
<td id="projectalign">
<div id="projectname">2 Dimensional Ising Model
</div>
<div id="projectbrief">Simulate the change in energy and magnetization in a ferro magnet</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('testlib_8hpp.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- 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">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">testlib.hpp File Reference</div></div>
</div><!--header-->
<div class="contents">
<p>A small test library.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="utils_8hpp_source.html">utils.hpp</a>&quot;</code><br />
<code>#include &lt;armadillo&gt;</code><br />
<code>#include &lt;string&gt;</code><br />
<code>#include &lt;type_traits&gt;</code><br />
</div>
<p><a href="testlib_8hpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a73d4f21ad937dbc50a0c0538c78fd4f9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="testlib_8hpp.html#a73d4f21ad937dbc50a0c0538c78fd4f9">ASSERT</a>(expr, msg)&#160;&#160;&#160; <a class="el" href="testlib_8hpp.html#a39abb7cba0535176ed62aae136d2fcc7">details::m_assert</a>(expr, #expr, <a class="el" href="utils_8hpp.html#a60dca3177fb9cb5256609adc7af55168">__METHOD_NAME__</a>, __FILE__, __LINE__, msg)</td></tr>
<tr class="memdesc:a73d4f21ad937dbc50a0c0538c78fd4f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">A prettier assertion function. <br /></td></tr>
<tr class="separator:a73d4f21ad937dbc50a0c0538c78fd4f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a39abb7cba0535176ed62aae136d2fcc7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="testlib_8hpp.html#a39abb7cba0535176ed62aae136d2fcc7">details::m_assert</a> (bool expr, std::string expr_str, std::string func, std::string file, int line, std::string msg)</td></tr>
<tr class="memdesc:a39abb7cba0535176ed62aae136d2fcc7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test an expression, confirm that test is ok, or abort execution. <br /></td></tr>
<tr class="separator:a39abb7cba0535176ed62aae136d2fcc7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A small test library. </p>
<dl class="section author"><dt>Author</dt><dd>Cory Alexander Balaton (coryab) </dd>
<dd>
Janita Ovidie Sandtrøen Willumsen (janitaws)</dd></dl>
<dl class="section version"><dt>Version</dt><dd>1.0</dd></dl>
<p>This a small testing library that is tailored for the needs of the project. Anything that is in the details namespace should not be used directly, or else it might cause undefined behavior if not used correctly.</p>
<dl class="bug"><dt><b><a class="el" href="bug.html#_bug000005">Bug:</a></b></dt><dd>No known bugs </dd></dl>
<p class="definition">Definition in file <a class="el" href="testlib_8hpp_source.html">testlib.hpp</a>.</p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a73d4f21ad937dbc50a0c0538c78fd4f9" name="a73d4f21ad937dbc50a0c0538c78fd4f9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a73d4f21ad937dbc50a0c0538c78fd4f9">&#9670;&#160;</a></span>ASSERT</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ASSERT</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">expr, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname">msg&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td>&#160;&#160;&#160; <a class="el" href="testlib_8hpp.html#a39abb7cba0535176ed62aae136d2fcc7">details::m_assert</a>(expr, #expr, <a class="el" href="utils_8hpp.html#a60dca3177fb9cb5256609adc7af55168">__METHOD_NAME__</a>, __FILE__, __LINE__, msg)</td>
</tr>
</table>
</div><div class="memdoc">
<p>A prettier assertion function. </p>
<p>This macro calls the m_assert function which is a more informative assertion function than the regular assert function from cassert. </p>
<p class="definition">Definition at line <a class="el" href="testlib_8hpp_source.html#l00031">31</a> of file <a class="el" href="testlib_8hpp_source.html">testlib.hpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a39abb7cba0535176ed62aae136d2fcc7" name="a39abb7cba0535176ed62aae136d2fcc7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a39abb7cba0535176ed62aae136d2fcc7">&#9670;&#160;</a></span>m_assert()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void details::m_assert </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>expr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::string&#160;</td>
<td class="paramname"><em>expr_str</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::string&#160;</td>
<td class="paramname"><em>func</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::string&#160;</td>
<td class="paramname"><em>file</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>line</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::string&#160;</td>
<td class="paramname"><em>msg</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Test an expression, confirm that test is ok, or abort execution. </p>
<p>This function takes in an expression and prints an OK message if it's true, or it prints a fail message and aborts execution if it fails.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">expr</td><td>The expression to be evaluated </td></tr>
<tr><td class="paramname">expr_str</td><td>The stringified version of the expression </td></tr>
<tr><td class="paramname">func</td><td>The function name of the caller </td></tr>
<tr><td class="paramname">file</td><td>The file of the caller </td></tr>
<tr><td class="paramname">line</td><td>The line number where this function is called from </td></tr>
<tr><td class="paramname">msg</td><td>The message to be displayed </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="testlib_8cpp_source.html#l00015">15</a> of file <a class="el" href="testlib_8cpp_source.html">testlib.cpp</a>.</p>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="testlib_8hpp.html">testlib.hpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6 </li>
</ul>
</div>
</body>
</html>