CAPD DynSys Library
5.2.0
|
This file provides a short description on how to use class Vector from CAPD package - for more details see header file "capd/vectalg/Vector.h".
Content of this file:
The template class Vector is defined in the namespace capd::vectalg and it has two parameters - type of elements stored in a vector and capacity.
If capacity is larger than zero, vector is represented as an array of given length inside the object.
If capacity is set to zero, the capacity of a vector must be set when the object is created.
One can change or access a coefficient in a vector by using operator[] or iterators. The following operations are available for vectors a,b
The index 'i' should be between 0 and the dimension of a vector minus 1, which can be easily obtained by a member function dimension as in the example below
The other way to access a coefficient in a vector is to use iterators instead of indexing. Class Vector provides type definitions for iterators and constant iterators.
Constant iterators for constant objects are defined in the similar way
The following standard operations on vectors are available
sum: a+b subtraction: a-b euclidean scalar product: a*b multiplication by scalar: 2*a, a*2 unary operator: -a equality: a==b, a!=b
Moreover, the standard operations like +=, -= etc. are available when possible.
The euclidean norm of a vector can be computed be using member function euclNorm
The vector can be normalized with respect to the euclidean norm by calling member function normalize
Many operations are suitable for interval vectors only. The most important are
splitting - this operation is useful in Lohner algorithm. The function split(v1,v2)
has two arguments, which are modified by this function in the following way (the actual implementation uses equivalent but optimized version): v2 = v1-midVector(v1); v1 = midVector(v1); After calling
one should obtain
diameter of a vector. This operation returns a vector which contains diameters of each coefficient in the argument.
After calling (with v2 as above)
one should obtain
subset(v1,v2)
verifies if the set represented as interval vector v1 is a subset of v2. Similar function subsetInterior(v1,v2)
verifies if v1 is a subset of the interior of v2.