Show
Ignore:
Timestamp:
10/12/09 13:49:39 (15 years ago)
Author:
mido
Message:

\doc directory cleaned a bit

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/doc/html/itfile.html

    r641 r651  
    1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    2 <html xmlns="http://www.w3.org/1999/xhtml"> 
    3 <head> 
    4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> 
     1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
     2<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> 
    53<title>mixpp: Writing and reading data from files</title> 
    6 <link href="tabs.css" rel="stylesheet" type="text/css"/> 
    7 <link href="doxygen.css" rel="stylesheet" type="text/css"/> 
    8 </head> 
    9 <body> 
    10 <!-- Generated by Doxygen 1.6.1 --> 
     4<link href="tabs.css" rel="stylesheet" type="text/css"> 
     5<link href="doxygen.css" rel="stylesheet" type="text/css"> 
     6</head><body> 
     7<!-- Generated by Doxygen 1.5.9 --> 
    118<script type="text/javascript"> 
    129<!-- 
     
    6360</div> 
    6461<div class="contents"> 
    65  
    66  
    67 <h1><a class="anchor" id="itfile">Writing and reading data from files </a></h1><p>Here we will use the <code>it_file</code> class to store some data. The program <code>write_it_file.cpp</code> looks as follows:</p> 
     62<h1><a class="anchor" name="itfile">Writing and reading data from files </a></h1>Here we will use the <code>it_file</code> class to store some data. The program <code>write_it_file.cpp</code> looks as follows:<p> 
    6863<div class="fragment"><pre class="fragment"><span class="preprocessor">#include &lt;itpp/itcomm.h&gt;</span> 
    6964 
     
    7469        it_file ff; 
    7570 
    76         <span class="comment">// Open a file with the name &quot;it_file_test.it&quot;</span> 
    77         ff.open ( <span class="stringliteral">&quot;it_file_test.it&quot;</span> ); 
     71        <span class="comment">// Open a file with the name "it_file_test.it"</span> 
     72        ff.open ( <span class="stringliteral">"it_file_test.it"</span> ); 
    7873 
    7974        <span class="comment">// Create some data to put into the file</span> 
    8075        vec a = linspace ( 1, 20, 20 ); 
    8176 
    82         <span class="comment">// Put the variable a into the file. The Name(&quot;a&quot;) tells the file class</span> 
    83         <span class="comment">// that the next variable shall be named &quot;a&quot;.</span> 
    84         ff &lt;&lt; Name ( <span class="stringliteral">&quot;a&quot;</span> ) &lt;&lt; a; 
     77        <span class="comment">// Put the variable a into the file. The Name("a") tells the file class</span> 
     78        <span class="comment">// that the next variable shall be named "a".</span> 
     79        ff &lt;&lt; Name ( <span class="stringliteral">"a"</span> ) &lt;&lt; a; 
    8580 
    8681        <span class="comment">// Force the file to be written to disc. This is useful when performing</span> 
     
    9590        <span class="keywordflow">return</span> 0; 
    9691} 
    97 </pre></div><p>When you run this program you will obtain a file called <code>it_file_test.it</code> in your current directory. You can read the file into Matlab/Octave to view the data by using the following commands:</p> 
    98 <div class="fragment"><pre class="fragment">itload(<span class="stringliteral">&apos;it_file_test.it&apos;</span>) 
     92</pre></div><p> 
     93When you run this program you will obtain a file called <code>it_file_test.it</code> in your current directory. You can read the file into Matlab/Octave to view the data by using the following commands:<p> 
     94<div class="fragment"><pre class="fragment">itload(<span class="stringliteral">'it_file_test.it'</span>) 
    9995figure(1); clf; 
    10096plot(a) 
    101 </pre></div><p>Note: Make sure that <code>$PREFIX/share/itpp</code> is in your Matlab/Octave path and that you run the code above from the directory where <code>it_file_test.it</code> is located (<code>$PREFIX</code> is the IT++ installation prefix; <code>/usr/local</code> by default).</p> 
    102 <p>The IT++ program <code>read_it_file.cpp</code> that reads the file and prints its content can look like this:</p> 
    103 <div class="fragment"><pre class="fragment"></pre></div><p>Here is the output of the program:</p> 
     97</pre></div><p> 
     98Note: Make sure that <code>$PREFIX/share/itpp</code> is in your Matlab/Octave path and that you run the code above from the directory where <code>it_file_test.it</code> is located (<code>$PREFIX</code> is the IT++ installation prefix; <code>/usr/local</code> by default).<p> 
     99The IT++ program <code>read_it_file.cpp</code> that reads the file and prints its content can look like this:<p> 
     100<div class="fragment"><pre class="fragment"></pre></div><p> 
     101Here is the output of the program:<p> 
    104102<div class="fragment"><pre class="fragment"> 
    105103a = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20] 
    106104</pre></div> </div> 
    107 <hr size="1"/><address style="text-align: right;"><small>Generated on Sun Sep 27 00:49:05 2009 for mixpp by&nbsp; 
     105<hr size="1"><address style="text-align: right;"><small>Generated on Wed Oct 7 17:34:44 2009 for mixpp by&nbsp; 
    108106<a href="http://www.doxygen.org/index.html"> 
    109 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> 
     107<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address> 
    110108</body> 
    111109</html>