packageVectors
Library of functions operating on vectors
Extends from Modelica.Icons.Package (Icon for standard packages).
Information
Library content
This library provides functions operating on vectors:
- toString(v) - returns the string representation of vector v.
- isEqual(v1, v2) - returns true if vectors v1 and v2 have the same size and the same elements.
- norm(v,p) - returns the p-norm of vector v.
- length(v) - returns the length of vector v (= norm(v,2), but inlined and therefore usable in symbolic manipulations)
- normalize(v) - returns vector in direction of v with length = 1 and prevents zero-division for zero vector.
- reverse(v) - reverses the vector elements of v.
- sort(v) - sorts the elements of vector v in ascending or descending order.
- find(e, v) - returns the index of the first occurrence of scalar e in vector v.
- interpolate(x, y, xi) - returns the interpolated value in (x,y) that corresponds to xi.
- relNodePositions(nNodes) - returns a vector of relative node positions (0..1).
See also
MatricesContents
| Name | Description |
|---|---|
| Convert a real vector in to a string representation | |
| Determine if two Real vectors are numerically identical | |
| Return the p-norm of a vector | |
| Return length of a vector (better as norm(), if further symbolic processing is performed) | |
| Return normalized vector such that length = 1 and prevent zero-division for zero vector | |
| Return normalized vector such that length = 1 (trigger an assert for zero vector) | |
| Reverse vector elements (e.g., v[1] becomes last element) | |
| Sort elements of vector in ascending or descending order | |
| Find element in a vector | |
| Interpolate linearly in a vector | |
| Return vector of relative node positions (0..1) |