Changeset 538 for library/doc/html/vector_and_matrix.html
- Timestamp:
- 08/16/09 18:14:04 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/doc/html/vector_and_matrix.html
r472 r538 5 5 <link href="doxygen.css" rel="stylesheet" type="text/css"> 6 6 </head><body> 7 <!-- Generated by Doxygen 1.5. 9-->7 <!-- Generated by Doxygen 1.5.8 --> 8 8 <script type="text/javascript"> 9 9 <!-- … … 69 69 <span class="keyword">using</span> std::endl; 70 70 71 <span class="keywordtype">int</span> main() 72 { 73 <span class="comment">//Declare vectors and matricies:</span> 74 vec a, b, c; 75 mat A, B; 71 <span class="keywordtype">int</span> main() { 72 <span class="comment">//Declare vectors and matricies:</span> 73 vec a, b, c; 74 mat A, B; 76 75 77 <span class="comment">//Use the function linspace to define a vector:</span>78 a = linspace(1.0, 2.0, 10);76 <span class="comment">//Use the function linspace to define a vector:</span> 77 a = linspace ( 1.0, 2.0, 10 ); 79 78 80 <span class="comment">//Use a string of values to define a vector:</span>81 b = <span class="stringliteral">"0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0"</span>;79 <span class="comment">//Use a string of values to define a vector:</span> 80 b = <span class="stringliteral">"0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0"</span>; 82 81 83 <span class="comment">//Add two vectors:</span>84 c = a + b;82 <span class="comment">//Add two vectors:</span> 83 c = a + b; 85 84 86 <span class="comment">//Print results:</span>87 cout << <span class="stringliteral">"a = "</span> << a << endl;88 cout << <span class="stringliteral">"b = "</span> << b << endl;89 cout << <span class="stringliteral">"c = "</span> << c << endl;85 <span class="comment">//Print results:</span> 86 cout << <span class="stringliteral">"a = "</span> << a << endl; 87 cout << <span class="stringliteral">"b = "</span> << b << endl; 88 cout << <span class="stringliteral">"c = "</span> << c << endl; 90 89 91 <span class="comment">//Use a string to define a matrix:</span>92 A = <span class="stringliteral">"1.0 2.0;3.0 4.0"</span>;90 <span class="comment">//Use a string to define a matrix:</span> 91 A = <span class="stringliteral">"1.0 2.0;3.0 4.0"</span>; 93 92 94 <span class="comment">//Calculate the inverse of matrix A:</span>95 B = inv(A);93 <span class="comment">//Calculate the inverse of matrix A:</span> 94 B = inv ( A ); 96 95 97 <span class="comment">//Print results:</span>98 cout << <span class="stringliteral">"A = "</span> << A << endl;99 cout << <span class="stringliteral">"B = "</span> << B << endl;96 <span class="comment">//Print results:</span> 97 cout << <span class="stringliteral">"A = "</span> << A << endl; 98 cout << <span class="stringliteral">"B = "</span> << B << endl; 100 99 101 <span class="comment">//Exit program:</span>102 <span class="keywordflow">return</span> 0;100 <span class="comment">//Exit program:</span> 101 <span class="keywordflow">return</span> 0; 103 102 104 103 } … … 114 113 </pre></div><p> 115 114 If this is what you see, then congratulations! You have managed to compile your first it++ program! </div> 116 <hr size="1"><address style="text-align: right;"><small>Generated on Wed Aug 5 00:06:512009 for mixpp by 115 <hr size="1"><address style="text-align: right;"><small>Generated on Sun Aug 16 17:58:18 2009 for mixpp by 117 116 <a href="http://www.doxygen.org/index.html"> 118 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5. 9</small></address>117 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> 119 118 </body> 120 119 </html>