1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
---|
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
4 | <head> |
---|
5 | <meta name="generator" content= |
---|
6 | "HTML Tidy for Linux/x86 (vers 1st March 2004), see www.w3.org" /> |
---|
7 | <meta http-equiv="Content-Type" content= |
---|
8 | "text/html; charset=us-ascii" /> |
---|
9 | <link href="ublas.css" type="text/css" /> |
---|
10 | <title>Boost Basic Linear Algebra</title> |
---|
11 | </head> |
---|
12 | <body> |
---|
13 | <h1><img src="../../../../boost.png" align="middle" /> |
---|
14 | Basic Linear Algebra</h1> |
---|
15 | <p>uBLAS is a C++ template class library that provides <a href= |
---|
16 | "http://www.netlib.org/blas">BLAS</a> level 1, 2, 3 functionality |
---|
17 | for dense, packed and sparse matrices. The design and |
---|
18 | implementation unify mathematical notation via operator overloading |
---|
19 | and efficient code generation via expression templates.</p> |
---|
20 | <h2>Functionality</h2> |
---|
21 | <p>uBLAS provides templated C++ classes for dense, unit and sparse |
---|
22 | vectors, dense, identity, triangular, banded, symmetric, hermitian |
---|
23 | and sparse matrices. Views into vectors and matrices can be |
---|
24 | constructed via ranges or slices and adaptor classes. The library |
---|
25 | covers the usual basic linear algebra operations on vectors and |
---|
26 | matrices: reductions like different norms, addition and subtraction |
---|
27 | of vectors and matrices and multiplication with a scalar, inner and |
---|
28 | outer products of vectors, matrix vector and matrix matrix products |
---|
29 | and triangular solver. The glue between containers, views and |
---|
30 | expression templated operations is a mostly <a href= |
---|
31 | "http://www.sgi.com/tech/stl">STL</a> conforming iterator |
---|
32 | interface.</p> |
---|
33 | <h2>Documentation</h2> |
---|
34 | <ul> |
---|
35 | <li><big><a href="overview.htm">Overview</a></big> |
---|
36 | <ul> |
---|
37 | <li><a href="overview.htm#rationale">Rationale</a> |
---|
38 | <li><a href="overview.htm#functionality">Functionality</a> |
---|
39 | <li><a href="types_overview.htm">Overview of Matrix- and Vector-Types</a></li> |
---|
40 | <li><a href="operations_overview.htm">Overview of Matrix and Vector Operations</a></li> |
---|
41 | <li><a href="#further_information">Effective uBLAS and further information</a></li> |
---|
42 | </ul> |
---|
43 | </li> |
---|
44 | <li><a href="vector.htm">Vector</a> |
---|
45 | <ul> |
---|
46 | <li><a href="vector.htm#vector">Vector</a></li> |
---|
47 | <li><a href="vector.htm#unit_vector">Unit Vector</a></li> |
---|
48 | <li><a href="vector.htm#zero_vector">Zero Vector</a></li> |
---|
49 | <li><a href="vector.htm#scalar_vector">Scalar Vector</a></li> |
---|
50 | </ul> |
---|
51 | </li> |
---|
52 | <li><a href="vector_sparse.htm">Sparse Vector</a> |
---|
53 | <ul> |
---|
54 | <li><a href="vector_sparse.htm#mapped_vector">Sparse |
---|
55 | Vector</a></li> |
---|
56 | <li><a href="vector_sparse.htm#compressed_vector">Compressed |
---|
57 | Vector</a></li> |
---|
58 | <li><a href="vector_sparse.htm#coordinate_vector">Coordinate |
---|
59 | Vector</a></li> |
---|
60 | </ul> |
---|
61 | </li> |
---|
62 | <li><a href="vector_proxy.htm">Vector Proxies</a> |
---|
63 | <ul> |
---|
64 | <li><a href="vector_proxy.htm#vector_range">Vector Range</a></li> |
---|
65 | <li><a href="vector_proxy.htm#vector_slice">Vector Slice</a></li> |
---|
66 | </ul> |
---|
67 | </li> |
---|
68 | <li><a href="vector_expression.htm">Vector Expressions</a> |
---|
69 | <ul> |
---|
70 | <li><a href="vector_expression.htm#vector_expression">Vector |
---|
71 | Expression</a></li> |
---|
72 | <li><a href="vector_expression.htm#vector_references">Vector |
---|
73 | References</a></li> |
---|
74 | <li><a href="vector_expression.htm#vector_operations">Vector |
---|
75 | Operations</a></li> |
---|
76 | <li><a href="vector_expression.htm#vector_reductions">Vector |
---|
77 | Reductions</a></li> |
---|
78 | </ul> |
---|
79 | </li> |
---|
80 | <li><a href="matrix.htm">Matrix</a> |
---|
81 | <ul> |
---|
82 | <li><a href="matrix.htm#matrix">Matrix</a></li> |
---|
83 | <li><a href="matrix.htm#identity_matrix">Identity Matrix</a></li> |
---|
84 | <li><a href="matrix.htm#zero_matrix">Zero Matrix</a></li> |
---|
85 | <li><a href="matrix.htm#scalar_matrix">Scalar Matrix</a></li> |
---|
86 | </ul> |
---|
87 | </li> |
---|
88 | <li><a href="triangular.htm">Triangular Matrix</a> |
---|
89 | <ul> |
---|
90 | <li><a href="triangular.htm#triangular_matrix">Triangular |
---|
91 | Matrix</a></li> |
---|
92 | <li><a href="triangular.htm#triangular_adaptor">Triangular |
---|
93 | Adaptor</a></li> |
---|
94 | </ul> |
---|
95 | </li> |
---|
96 | <li><a href="symmetric.htm">Symmetric Matrix</a> |
---|
97 | <ul> |
---|
98 | <li><a href="symmetric.htm#symmetric_matrix">Symmetric |
---|
99 | Matrix</a></li> |
---|
100 | <li><a href="symmetric.htm#symmetric_adaptor">Symmetric |
---|
101 | Adaptor</a></li> |
---|
102 | </ul> |
---|
103 | </li> |
---|
104 | <li><a href="hermitian.htm">Hermitian Matrix</a> |
---|
105 | <ul> |
---|
106 | <li><a href="hermitian.htm#hermitian_matrix">Hermitian |
---|
107 | Matrix</a></li> |
---|
108 | <li><a href="hermitian.htm#hermitian_adaptor">Hermitian |
---|
109 | Adaptor</a></li> |
---|
110 | </ul> |
---|
111 | </li> |
---|
112 | <li><a href="banded.htm">Banded Matrix</a> |
---|
113 | <ul> |
---|
114 | <li><a href="banded.htm#banded_matrix">Banded Matrix</a></li> |
---|
115 | <li><a href="banded.htm#banded_adaptor">Banded Adaptor</a></li> |
---|
116 | </ul> |
---|
117 | </li> |
---|
118 | <li><a href="matrix_sparse.htm">Sparse Matrix</a> |
---|
119 | <ul> |
---|
120 | <li><a href="matrix_sparse.htm#mapped_matrix">Sparse |
---|
121 | Matrix</a></li> |
---|
122 | <li><a href="matrix_sparse.htm#compressed_matrix">Compressed |
---|
123 | Matrix</a></li> |
---|
124 | <li><a href="matrix_sparse.htm#coordinate_matrix">Coordinate |
---|
125 | Matrix</a></li> |
---|
126 | </ul> |
---|
127 | </li> |
---|
128 | <li><a href="matrix_proxy.htm">Matrix Proxies</a> |
---|
129 | <ul> |
---|
130 | <li><a href="matrix_proxy.htm#matrix_row">Matrix Row</a></li> |
---|
131 | <li><a href="matrix_proxy.htm#matrix_column">Matrix Column</a></li> |
---|
132 | <li><a href="matrix_proxy.htm#vector_range">Vector Range</a></li> |
---|
133 | <li><a href="matrix_proxy.htm#vector_slice">Vector Slice</a></li> |
---|
134 | <li><a href="matrix_proxy.htm#matrix_range">Matrix Range</a></li> |
---|
135 | <li><a href="matrix_proxy.htm#matrix_slice">Matrix Slice</a></li> |
---|
136 | </ul> |
---|
137 | </li> |
---|
138 | <li><a href="matrix_expression.htm">Matrix Expressions</a> |
---|
139 | <ul> |
---|
140 | <li><a href="matrix_expression.htm#matrix_expression">Matrix |
---|
141 | Expression</a></li> |
---|
142 | <li><a href="matrix_expression.htm#matrix_references">Matrix |
---|
143 | References</a></li> |
---|
144 | <li><a href="matrix_expression.htm#matrix_operations">Matrix |
---|
145 | Operations</a></li> |
---|
146 | <li><a href="matrix_expression.htm#matrix_vector_operations">Matrix |
---|
147 | Vector Operations</a></li> |
---|
148 | <li><a href="matrix_expression.htm#matrix_matrix_operations">Matrix |
---|
149 | Matrix Operations</a></li> |
---|
150 | </ul> |
---|
151 | </li> |
---|
152 | <li>Storage and special containers |
---|
153 | <ul> |
---|
154 | <li><a href="unbounded_array.htm">Unbounded Array</a></li> |
---|
155 | <li><a href="bounded_array.htm">Bounded Array</a></li> |
---|
156 | <li><a href="range.htm#range">Range</a></li> |
---|
157 | <li><a href="range.htm#slice">Slice</a></li> |
---|
158 | </ul> |
---|
159 | </li> |
---|
160 | <li><a href="storage_sparse.htm">Sparse Storage</a> |
---|
161 | <ul> |
---|
162 | <li><a href="storage_sparse.htm#map_std">Default Standard |
---|
163 | Map</a></li> |
---|
164 | <li><a href="storage_sparse.htm#map_array">Map Array</a></li> |
---|
165 | </ul> |
---|
166 | </li> |
---|
167 | <li>Operations & Functions |
---|
168 | <ul> |
---|
169 | <li><a href="products.htm">Special Products</a></li> |
---|
170 | <li><a href="blas.htm">BLAS</a></li> |
---|
171 | </ul> |
---|
172 | <li>uBLAS Concept definitions |
---|
173 | <ul> |
---|
174 | <li><a href="container_concept.htm">Container Concepts</a> |
---|
175 | <ul> |
---|
176 | <li><a href="container_concept.htm#vector">Vector</a></li> |
---|
177 | <li><a href="container_concept.htm#matrix">Matrix</a></li> |
---|
178 | </ul> |
---|
179 | <li><a href="expression_concept.htm">Expression Concepts</a> |
---|
180 | <ul> |
---|
181 | <li><a href="expression_concept.htm#scalar_expression">Scalar |
---|
182 | Expression</a></li> |
---|
183 | <li><a href="expression_concept.htm#vector_expression">Vector |
---|
184 | Expression</a></li> |
---|
185 | <li><a href="expression_concept.htm#matrix_expression">Matrix |
---|
186 | Expression</a></li> |
---|
187 | </ul> |
---|
188 | <li><a href="storage_concept.htm">Storage Concept</a> |
---|
189 | <li><a href="iterator_concept.htm">Iterator Concepts</a> |
---|
190 | <ul> |
---|
191 | <li><a href="iterator_concept.htm#indexed_bidirectional_iterator">Indexed |
---|
192 | Bidirectional Iterator</a></li> |
---|
193 | <li><a href="iterator_concept.htm#indexed_random_access_iterator">Indexed |
---|
194 | Random Access Iterator</a></li> |
---|
195 | <li><a href= |
---|
196 | "iterator_concept.htm#indexed_bidirectional_cr_iterator">Indexed |
---|
197 | Bidirectional Column/Row Iterator</a></li> |
---|
198 | <li><a href= |
---|
199 | "iterator_concept.htm#indexed_random_access_cr_iterator">Indexed Random |
---|
200 | Access Column/Row Iterator</a></li> |
---|
201 | </ul> |
---|
202 | </li> |
---|
203 | </ul> |
---|
204 | </li> |
---|
205 | </ul> |
---|
206 | <h2>Supported Platforms</h2> |
---|
207 | <p>The current version of uBLAS expects a modern (ISO standard compliant) compiler. Compilers targeted and tested |
---|
208 | with this release are:</p> |
---|
209 | <ul> |
---|
210 | <li>GCC 3.2.3, 3.3.x, 3.4.x, 4.0.x</li> |
---|
211 | <li>MSVC 7.1, 8.0</li> |
---|
212 | <li>ICC 8.0, 8.1</li> |
---|
213 | <li>Visual age 6</li> |
---|
214 | <li>Codewarrior 9.4, 9.5</li> |
---|
215 | </ul> |
---|
216 | <p>The version of uBLAS in Boost 1.32.0 (and earlier) support many older compilers. If you are |
---|
217 | using such a compiler please use this version of uBLAS. Compilers known to accept this older library |
---|
218 | are:</p> |
---|
219 | <ul> |
---|
220 | <li>MSVC 6.0 with STLPort-4.5.3, 7.0, 7.1</li> |
---|
221 | <li>GCC 2.95.x, 3.0.x, 3.1.x, 3.2.x, 3.3.x, 3.4.x</li> |
---|
222 | <li>ICC 7.0, 7.1 8.0</li> |
---|
223 | <li>Comeau 4.2.x</li> |
---|
224 | <li>Codewarrior 8.3</li> |
---|
225 | </ul> |
---|
226 | <p>For possible problems please consider to consult the Boost |
---|
227 | regression tests.</p> |
---|
228 | <a name="further_information"></a> |
---|
229 | <h2>Known limitations:</h2> |
---|
230 | <ul type="Disc"> |
---|
231 | <li>The implementation assumes a linear memory address model.</li> |
---|
232 | <li>Tuning was focussed on dense matrices.</li> |
---|
233 | </ul> |
---|
234 | <h2>Further Information</h2> |
---|
235 | <h3>Project Location and Download</h3> |
---|
236 | <p>The latest stable release of uBLAS is part of the <a href= |
---|
237 | "http://www.boost.org">Boost</a> libraries.</p> |
---|
238 | <h3>Documentation and Discussion</h3> |
---|
239 | <p>Visit the <a href= |
---|
240 | "http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Effective_UBLAS"> |
---|
241 | Effective uBLAS</a> wiki for up to date information and |
---|
242 | contributions.</p> |
---|
243 | <p>There is also an active uBLAS <a href= |
---|
244 | "http://lists.boost.org/">mailing list</a> where uBLAS specific |
---|
245 | user and development questions are answered.</p> |
---|
246 | <h3>uBLAS and Boost Project</h3> |
---|
247 | <p>There is also an active uBLAS <a href= |
---|
248 | "http://lists.boost.org/">mailing list</a> where uBLAS specific |
---|
249 | from the latest uBLAS project code. You can <a href= |
---|
250 | "http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/boost">view</a> the |
---|
251 | Boost CVS archive directly. You will find the library <a href= |
---|
252 | "http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/boost/boost/boost/numeric/ublas/"> |
---|
253 | here</a>. Documentation and test programs reside <a href= |
---|
254 | "http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/boost/boost/libs/numeric/ublas/"> |
---|
255 | here</a>.</p> |
---|
256 | <h2>Authors and Credits</h2> |
---|
257 | <p>uBLAS initially was written by Joerg Walter and Mathias Koch. We |
---|
258 | would like to thank all, which supported and contributed to the |
---|
259 | development of this library: David Abrahams, Ed Brey, Fernando |
---|
260 | Cacciola, Juan Jose Gomez Cadenas, Beman Dawes, Matt Davies, Bob |
---|
261 | Fletcher, Kresimir Fresl, Joachim Kessel, Patrick Kowalzick, Toon |
---|
262 | Knapen, Hendrik Kueck, John Maddock, Jens Maurer, Alexei Novakov, |
---|
263 | Gary Powell, Joachim Pyras, Peter Schmitteckert, Jeremy Siek, |
---|
264 | Markus Steffl, Michael Stevens, Benedikt Weber, Martin Weiser, |
---|
265 | Gunter Winkler, Marc Zimmermann and the members of <a href= |
---|
266 | "http://www.boost.org">Boost</a></p> |
---|
267 | <h2>Frequently Asked Questions</h2> |
---|
268 | <p>Q: I'm running the uBLAS dense vector and matrix benchmarks. Why |
---|
269 | do I see a significant performance difference between the native C |
---|
270 | and library implementations?<br /> |
---|
271 | A: uBLAS distinguishes debug mode (size and type conformance checks |
---|
272 | enabled, expression templates disabled) and release mode (size and |
---|
273 | type conformance checks disabled, expression templates enabled). |
---|
274 | Please check, if the preprocessor symbol <code>NDEBUG</code> of |
---|
275 | <code>cassert</code> is defined. <code>NDEBUG</code> enables |
---|
276 | release mode, which in turn uses expression templates.</p> |
---|
277 | <p>Q: I've written some uBLAS tests, which try to incorrectly |
---|
278 | assign different matrix types or overrun vector and matrix |
---|
279 | dimensions. Why don't I get a compile time or runtime |
---|
280 | diagnostic?<br /> |
---|
281 | A: uBLAS distinguishes debug mode (size and type conformance checks |
---|
282 | enabled, expression templates disabled) and release mode (size and |
---|
283 | type conformance checks disabled, expression templates enabled). |
---|
284 | Please check, if the preprocessor symbol <code>NDEBUG</code> of |
---|
285 | <code>cassert</code> is defined. <code>NDEBUG</code> disables debug |
---|
286 | mode, which is needed to get size and type conformance checks.</p> |
---|
287 | <p>Q: I've written some uBLAS benchmarks to measure the performance |
---|
288 | of matrix chain multiplications like <code>prod (A, prod (B, |
---|
289 | C))</code> and see a significant performance penalty due to the use |
---|
290 | of expression templates. How can I disable expression |
---|
291 | templates?<br /> |
---|
292 | A: You do not need to disable expression templates. Please try |
---|
293 | reintroducing temporaries using either <code>prod (A,</code> |
---|
294 | <code><em>matrix_type</em></code> <code>(prod (B, C)))</code> or |
---|
295 | <code>prod (A, prod<</code><code><em>matrix_type</em></code> |
---|
296 | <code>> (B, C))</code>.</p> |
---|
297 | <hr /> |
---|
298 | <p>Copyright (©) 2000-2002 Joerg Walter, Mathias Koch<br /> |
---|
299 | Permission to copy, use, modify, sell and distribute this document |
---|
300 | is granted provided this copyright notice appears in all copies. |
---|
301 | This document is provided ``as is'' without express or implied |
---|
302 | warranty, and with no claim as to its suitability for any |
---|
303 | purpose.</p> |
---|
304 | </body> |
---|
305 | </html> |
---|