1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
/*
* $Id: intro.dox,v 1.12 2004/11/30 09:05:53 opetzold Exp $
*/
/**
\mainpage
\section intro_contents Contents
- \ref introduction
- \ref license
- \ref news
- \ref changelog
- \ref benchmark
- \ref build
- \ref usage
- \ref faq
- \ref notes
- \ref compiler
- \ref works
- \ref credits
- \ref projects
- \ref links
*/
/**
\page introduction Introduction
This Tiny %Vector and %Matrix template library uses
<a href=http://extreme.indiana.edu/~tveldhui/papers/Template-Metaprograms/meta-art.html>Meta Templates</a>
(MT) and <a href=http://extreme.indiana.edu/~tveldhui/papers/Expression-Templates/exprtmpl.html>
Expression Templates</a> (ET) to evaluate results at compile time -- which
makes it fast for low order (tiny) systems. "Tiny" is a subjective term,
but typically means vectors and matrices of size ten (10) or less.
The technique used internally by tvmet is described by Todd Veldhuizen:
- <a href=http://osl.iu.edu/~tveldhui/papers/techniques/>
Techniques for Scientific C++</a>
- <a href=http://osl.iu.edu/~tveldhui/papers/Expression-Templates/exprtmpl.html>
Expression Templates</a>
- <a href=http://osl.iu.edu/~tveldhui/papers/Template-Metaprograms/meta-art.html>
Template Metaprograms</a>
and is used by his <a href=http://oonumerics.org/blitz/>blitz++</a>, too.
Therefore, the speed achieved by tvmet is similar to the speed of blitz++.
Unfortunately, blitz++ isn't developed any more (year 2001, 2002)
because of other interests being pursued by Todd Veldhuizen (like his Ph.D.).
Furthermore, blitz++'s TinyVector is mainly developed for use by the blitz++
Array class -- and not for minimalistic/tiny fast math support for which
tvmet <b>is</b> designed. Because of this, the operators and functions are
incomplete or not supported well. blitz::TinyMatrix supports a few lesser
operators and functions (as with blitz::TinyVector). blitz++ doesn't conform
to STL (e.g. Container<>::value_type isn't defined), it defines a T_numtype
or, for blitz::TinyVector, it does have an iterator begin() - but the end()
is missing (blitz::TinyMatrix doesn't have anything).
These were reasons why I developed tvmet. Still, tvmet is designed to be more
than a mere rehashing of blitz++. The primary design goals are:
-# mathematical notation and correctness,
-# high efficiency for small/tiny vector and matrices,
-# functionality and wide range of supported operators and functions, and
-# compatibility and portability.
The dimensions for vectors and matrices are statically bound at compile
time using template arguments. The bounded dimensions feature a <b>compile
time dimension check</b> to force adherence to proper dimensional sizes
between operands (even in the night if you are sleepy). For example, you
can't assign a %Vector or %Matrix with dimension = 3 to a %Vector or %Matrix
of dimension = 4; nor can you create an expression using a binary operation
between arguments with incompatible dimensions. This is a major difference
between tvmet (which features this) and blitz++ (which does not prevent
from this). Nevertheless, tvmet isn't a matlab, maple or octave for C++.
tvmet is a general purpose library and is not (yet) a linear algebra library.
It does not have an interface to other numerical libraries as BLAS or LAPACK.
<a href="http://sourceforge.net/projects/tvmet">Tiny Vector Matrix template
library</a> offers these features:
-# Matrices and Vectors with fixed sizes (of course), the data is stored in
a static array.
-# compile time dimension check for Vectors and Matrices to preserve the
mathematical meaning.
-# vector, matrix, matrix-matrix and matrix-vector fast operations:
- complete set of standard arithmetic operations for Vectors and Matrices
(<a href=http://oonumerics.org/blitz/>blitz++</a> supports this only for
TinyVector).
- complete set of standard compare operations for Vectors and Matrices
as well as ternary functions like <tt>a ? b : c</tt> (see eval for use).
- binary and unary operations.
- meta template use for %Matrix-Matrix-Product \f$M\,M\f$,
%Matrix-Transpose \f$M^T\f$ and %Matrix-Vector-Product \f$M\,x\f$
functions and operators.
- meta template for special functions like
\f$M^T\, x\f$, \f$M^T\,M\f$, \f$M\,M^T\f$ and \f$(M\,M)^T\f$
functions, see \ref spec_meta_func.
- simple %Matrix rows and column access as a %Vector.
- chaining of matrix and vector expressions is possible and working.
- %Vector inner and outer product (dot and cross product).
-# special handling for the aliasing problem - see \ref alias.
-# STL iterator interface. This opens the door to all sorts of great STL
applications.
-# type promotion (for handling Matrices and Vectors of differing types).
-# works on self defined types such as the std::complex<> type.
-# makes no use of exceptions. Therefore you can use it for embedded systems
or in Linux kernel space.
-# nice expression level printing for debugging purposes (print the expanded
expression tree).
-# good documentation with examples.
-# regression tests for nearly all operations and functions.
-# support for several compilers (see \ref compiler).
-# written as a pure class and template library, no binary libraries and
versioning are needed - designed to avoid code blot due to the use of
templates.
-# ISO/IEC 14882:1998 compliant.
Although there are many advantages and features, tvmet has some limitations.
Due to the expression template and meta template programming, the compilation
time increases for higher dimensional constructs. This can cause resource
limitations, especially for memory (during compilation). On the other hand,
the runtime performance will also decrease on higher order. Therefore only
use tvmet only tiny (typically less than 10) sizes. (The maximum useful
size/dimension depends on the operation, of course.) The \ref benchmark
gives a good entry point about these problem.
<a href=http://www.oonumerics.org/oon/#libraries>Other</a>
general purpose libraries and linear algebra libraries will do a better job
for larger matrix/vector problems.
*/
/**
\bugs regression test TestUnFunc::Arc and TestUnFunc::Log fails due to
precision errors.
*/
// Local Variables:
// mode:c++
// End:
|