tinyvector.texi   tinyvector.texi 
skipping to change at line 18 skipping to change at line 18
Note that @code{TinyVector} lives in the @code{blitz} namespace, so you wil l Note that @code{TinyVector} lives in the @code{blitz} namespace, so you wil l
need to refer to it as @code{blitz::TinyVector}, or use the directive need to refer to it as @code{blitz::TinyVector}, or use the directive
@code{using namespace blitz;}. @code{using namespace blitz;}.
The Blitz++ @code{Array} object uses @code{TinyVector} internally, so if yo u The Blitz++ @code{Array} object uses @code{TinyVector} internally, so if yo u
include @code{<blitz/array.h>}, the @code{TinyVector} header is automatical ly include @code{<blitz/array.h>}, the @code{TinyVector} header is automatical ly
included. However, to use @code{TinyVector} expressions, you will included. However, to use @code{TinyVector} expressions, you will
need to include @code{<blitz/tinyvec-et.h>}. need to include @code{<blitz/tinyvec-et.h>}.
@node TinyVec params, TinyVec ctors, , TinyVector
@section Template parameters and types @section Template parameters and types
The @code{TinyVector<T,N>} class has two template parameters: The @code{TinyVector<T,N>} class has two template parameters:
@table @code @table @code
@item T @item T
is the numeric type of the vector (float, double, int, is the numeric type of the vector (float, double, int,
@code{complex<float>}, etc.; @code{complex<float>}, etc.;
@item N @item N
skipping to change at line 47 skipping to change at line 48
@item T_vector @item T_vector
is the vector type @code{TinyVector<T,N>}. is the vector type @code{TinyVector<T,N>}.
@item iterator @item iterator
is an STL-style iterator. is an STL-style iterator.
@item constIterator @item constIterator
is an STL-style const iterator. is an STL-style const iterator.
@end table @end table
@node TinyVec ctors, TinyVec members, TinyVec params, TinyVector
@section Constructors @section Constructors
@example @example
TinyVector(); TinyVector();
@end example @end example
The elements of the vector are left uninitialized. The elements of the vector are left uninitialized.
@example @example
TinyVector(const TinyVector<T,N>& x); TinyVector(const TinyVector<T,N>& x);
@end example @end example
skipping to change at line 70 skipping to change at line 72
TinyVector(T value); TinyVector(T value);
@end example @end example
All elements are initialized to @code{value}. All elements are initialized to @code{value}.
@example @example
TinyVector(T value1, T value2, ...); TinyVector(T value1, T value2, ...);
@end example @end example
The vector is initialized with the list of values given. The vector is initialized with the list of values given.
These constructors are provided for up to N=11. These constructors are provided for up to N=11.
@node TinyVec members, TinyVec assignment, TinyVec ctors, TinyVector
@section Member functions @section Member functions
@example @example
TinyVector<T,N>::iterator begin(); TinyVector<T,N>::iterator begin();
TinyVector<T,N>::const_iterator begin() const; TinyVector<T,N>::const_iterator begin() const;
@end example @end example
Returns an STL-style iterator for the vector, positioned Returns an STL-style iterator for the vector, positioned
at the beginning of the data. at the beginning of the data.
@example @example
skipping to change at line 106 skipping to change at line 109
@example @example
T_numtype operator()(int i) const; T_numtype operator()(int i) const;
T_numtype& operator()(int i); T_numtype& operator()(int i);
T_numtype operator[](int i) const; T_numtype operator[](int i) const;
T_numtype& operator[](int i); T_numtype& operator[](int i);
@end example @end example
Returns the @code{i}th element of the vector. If the code is compiled with Returns the @code{i}th element of the vector. If the code is compiled with
debugging enabled (@code{-DBZ_DEBUG}), bounds checking is performed. debugging enabled (@code{-DBZ_DEBUG}), bounds checking is performed.
@node TinyVec assignment, TinyVec exprs, TinyVec members, TinyVector
@section Assignment operators @section Assignment operators
The assignment operators =, +=, -=, *=, /=, %=, ^=, &=, |=, >>= and <<= are The assignment operators =, +=, -=, *=, /=, %=, ^=, &=, |=, >>= and <<= are
all provided. The right hand side of an assignment may be a scalar of type all provided. The right hand side of an assignment may be a scalar of type
@code{T_numtype}, a @code{TinyVector} of any type but the same size, or a @code{T_numtype}, a @code{TinyVector} of any type but the same size, or a
vector expression. vector expression.
@node TinyVec exprs, TinyVec globals, TinyVec assignment, TinyVector
@section Expressions @section Expressions
Expressions involving tiny vectors may contain any combination Expressions involving tiny vectors may contain any combination
of the operators of the operators
@example @example
+ - * / % ^ & | >> << + - * / % ^ & | >> <<
@end example @end example
with operands of type TinyVector, scalar, or vector expressions. with operands of type TinyVector, scalar, or vector expressions.
The usual math functions (see the Array documentation) are supported The usual math functions (see the Array documentation) are supported
on TinyVector. on TinyVector. Please note that to use @code{TinyVector} expressions,
you will need to include header @code{<blitz/tinyvec-et.h>} in your code.
@node TinyVec globals, TinyVec arrays, TinyVec exprs, TinyVector
@section Global functions @section Global functions
@example @example
dot(TinyVector, TinyVector); dot(TinyVector, TinyVector);
dot(vector-expr, TinyVector); dot(vector-expr, TinyVector);
dot(TinyVector, vector-expr); dot(TinyVector, vector-expr);
dot(vector-expr, vector-expr); dot(vector-expr, vector-expr);
@end example @end example
These functions calculate a dot product between @code{TinyVector}s These functions calculate a dot product between @code{TinyVector}s
(or vector expressions). The result is a scalar; the type (or vector expressions). The result is a scalar; the type
skipping to change at line 153 skipping to change at line 160
@example @example
sum(TinyVector); sum(TinyVector);
@end example @end example
Returns the sum of the elements in the vector. Returns the sum of the elements in the vector.
@example @example
TinyVector<T,3> cross(TinyVector<T,3> x, TinyVector<T,3> y); TinyVector<T,3> cross(TinyVector<T,3> x, TinyVector<T,3> y);
@end example @end example
Returns the cross product of @code{x} and @code{y}. Returns the cross product of @code{x} and @code{y}.
@section Arrays of @code{TinyVector} @node TinyVec arrays, TinyVec io, TinyVec globals, TinyVector
@section Arrays of TinyVector
TinyVectors may be used as an Array element type, just like any other concr
ete
numerical data type such as the built-in type @code{double}. Such an Array
of TinyVector elements constitutes a multicomponent Array, with the number
of
Array components being equal to the length of the TinyVectors. Please see
@ref{Array multi} for further information.
@node TinyVec io, , TinyVec arrays, TinyVector
@section Input/output @section Input/output
@example @example
ostream& operator<<(ostream&, const TinyVector<T,N>& x); ostream& operator<<(ostream&, const TinyVector<T,N>& x);
@end example @end example
This function outputs a @code{TinyVector} onto a stream. Here's This function outputs a @code{TinyVector} onto a stream. Here's
an illustration of the format for a length 3 vector: an illustration of the format for a length 3 vector:
@example @example
[ 0.5 0.2 0.9 ] [ 0.5 0.2 0.9 ]
 End of changes. 9 change blocks. 
2 lines changed or deleted 19 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/