This library provides functions operating on vectors:
Function | Description |
---|---|
isEqual(v1, v2) | Determines whether two vectors have the same size and elements |
norm(v,p) | p-norm of vector v |
length(v) | Length of vector v (= norm(v,2), but inlined and therefore usable in symbolic manipulations) |
normalize(v) | Return normalized vector such that length = 1 and prevent zero-division for zero vector |
reverse(v) | Reverse vector elements |
sort(v) | Sort elements of vector in ascending or descending order |
Extends from Modelica.Icons.Library (Icon for library).
Name | Description |
---|---|
![]() | find element in vector |
![]() | reflect vector a on a plane with orthogonal vector u |
![]() | reflect vector a to the unity vector e_1={1,0,...,0} |
![]() | reflect vector a to the unity vector e_n={0, ..., 0, 1} |
![]() | calculate a normalized householder vector for the reflexion of vector a onto vector b |
![]() | Return length of a vector |
![]() | print vector |
Name | Description |
---|---|
s | Search for s |
v[:] | Vector |
Name | Description |
---|---|
result | v[result] = s (first occurrence of s); result=0, if not found |
Name | Description |
---|---|
a[:] | |
u[size(a, 1)] | householder vector |
Name | Description |
---|---|
ra[size(u, 1)] | reflexion of a |
Name | Description |
---|---|
a[:] | |
u[size(a, 1)] | householder vector |
Name | Description |
---|---|
ra[size(u, 1)] | reflexion of a |
Name | Description |
---|---|
a[:] | |
u[size(a, 1)] | householder vector |
Name | Description |
---|---|
ra[size(u, 1)] | reflexion of a |
Vectors.householderVector(a, b);
The function call "householderVector(a, b)
" returns vector
u, which is the normalized Householder vector for a Householder
reflexion with matrix Q
Q = I - 2*u*u'
with
Q*a = c*b
Name | Description |
---|---|
a[:] | |
b[size(a, 1)] |
Name | Description |
---|---|
u[size(a, 1)] |
Vectors.length(v);
The function call "Vectors.length(v)
" returns the
Euclidean length "sqrt(v*v)
" of vector v.
The function call is equivalent to Vectors.norm(v). The advantage of
length(v) over norm(v)"is that function length(..) is implemented
in one statement and therefore the function is usually automatically
inlined. Further symbolic processing is therefore possible, which is
not the case with function norm(..).
v = {2, -4, -2, -1}; length(v); // = 5
Name | Description |
---|---|
v[:] | Vector |
Name | Description |
---|---|
result | Length of vector v |
Name | Description |
---|---|
v[:] | |
significantDigits | Number of significant digits that are shown |
name | Independent variable name used for printing |
Name | Description |
---|---|
s |