tcheck.cpp.html - numeric - C++ library with numerical algorithms
(HTM) git clone git://src.adamsgaard.dk/numeric
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
tcheck.cpp.html (3169B)
---
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
5 <title>~/code/numeric/exam/check.cpp.html</title>
6 <meta name="Generator" content="Vim/7.4">
7 <meta name="plugin-version" content="vim7.4_v1">
8 <meta name="syntax" content="cpp">
9 <meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
10 <meta name="colorscheme" content="desert">
11 <style type="text/css">
12 <!--
13 pre { white-space: pre-wrap; font-family: monospace; color: #ffffff; background-color: #000000; }
14 body { font-family: monospace; color: #ffffff; background-color: #000000; }
15 * { font-size: 1em; }
16 .Type { color: #008000; }
17 .Statement { color: #804000; }
18 .LineNr { color: #804000; }
19 .Comment { color: #008080; }
20 .Constant { color: #af5f00; }
21 .Special { color: #c000c0; }
22 .PreProc { color: #c000c0; }
23 -->
24 </style>
25
26 <script type='text/javascript'>
27 <!--
28
29 /* function to open any folds containing a jumped-to line before jumping to it */
30 function JumpToLine()
31 {
32 var lineNum;
33 lineNum = window.location.hash;
34 lineNum = lineNum.substr(1); /* strip off '#' */
35
36 if (lineNum.indexOf('L') == -1) {
37 lineNum = 'L'+lineNum;
38 }
39 lineElem = document.getElementById(lineNum);
40 /* Always jump to new location even if the line was hidden inside a fold, or
41 * we corrected the raw number to a line ID.
42 */
43 if (lineElem) {
44 lineElem.scrollIntoView(true);
45 }
46 return true;
47 }
48 if ('onhashchange' in window) {
49 window.onhashchange = JumpToLine;
50 }
51
52 -->
53 </script>
54 </head>
55 <body onload='JumpToLine();'>
56 <pre id='vimCodeElement'>
57 <span id="L1" class="LineNr"> 1 </span><span class="Comment">// Function used for reporting the condition of a </span>
58 <span id="L2" class="LineNr"> 2 </span><span class="Comment">// statement to stdout using ANSI colors.</span>
59 <span id="L3" class="LineNr"> 3 </span><span class="PreProc">#include </span><span class="Constant"><iostream></span>
60 <span id="L4" class="LineNr"> 4 </span>
61 <span id="L5" class="LineNr"> 5 </span><span class="Type">void</span> check(<span class="Type">const</span> <span class="Type">bool</span> statement)
62 <span id="L6" class="LineNr"> 6 </span>{
63 <span id="L7" class="LineNr"> 7 </span> <span class="Statement">if</span> (statement == <span class="Constant">true</span>)
64 <span id="L8" class="LineNr"> 8 </span> std::cout << <span class="Constant">"</span><span class="Special">\t\033</span><span class="Constant">[0;32mPassed</span><span class="Special">\033</span><span class="Constant">[0m</span><span class="Special">\n</span><span class="Constant">"</span>;
65 <span id="L9" class="LineNr"> 9 </span> <span class="Statement">else</span>
66 <span id="L10" class="LineNr">10 </span> std::cout << <span class="Constant">"</span><span class="Special">\t\033</span><span class="Constant">[1;31mFail!!</span><span class="Special">\033</span><span class="Constant">[0m</span><span class="Special">\n</span><span class="Constant">"</span>;
67 <span id="L11" class="LineNr">11 </span>}
68 </pre>
69 </body>
70 </html>
71 <!-- vim: set foldmethod=manual : -->