VISH
0.2
|
A FixedArray is a simple copy-by-value array providing random access to its elements. More...
#include </home/werner/origo/vish/ocean/eagle/FixedArray.hpp>
A FixedArray is a simple copy-by-value array providing random access to its elements.
Its purpose is to implement small, light-weight types such as 3-vectors, 3x3 matrices and similar, useful for small efficient numerical operations, as they don't have an new/delete memory allocation overhead. The FixedArray does not provide operations on its elements - use class Vector for this purpose.
Copying or creating temporary FixedArray objects should be avoided, as the entire data fields are copied.
static FixedArray Eagle::FixedArray::convert | ( | const FixedArray< T, N > & | F, |
const ConversionFunctor & | CF | ||
) | [inline, static] |
Perform a type conversion on a given fixed array into another basis type:
FixedArray<double, 3> data; FixedArray<int,3> idata = FixedArray<int, 3>::convert( data );
This is implemented as a type-safe static member function, thus allows explicit type conversion when calling polymorphic or template functions.
const FixedArray<value, subsize>* Eagle::FixedArray::get_subarray | ( | ) | const [inline] |
Same functionality as the subarray template member class, but simpler interface.
Example:
const FixedArray<3 , CoordinateType>*P3D; const FixedArray<2 , CoordinateType>*P2D; P2D = P3D->get_subarray<2,0>();
bool Eagle::FixedArray::operator!= | ( | const FixedArray< T, N > & | F | ) | const [inline] |
Compare two arrays.
The types might differ, but the length must be identical. The comparision loop is terminated at the first type mismatch.
bool Eagle::FixedArray::operator== | ( | const FixedArray< T, N > & | F | ) | const [inline] |
Compare two arrays.
The types might differ, but the length must be identical. The comparision loop is terminated at the first type mismatch.
void Eagle::FixedArray::setFromArray | ( | const value * | x, |
int | length = SIZE , |
||
int | offset = 0 |
||
) | [inline] |
Set all array elements to an array's element value.
Note that the array must have at least the same length as the FixedArray.
bool isEqual | ( | const FixedArray< value, N > & | L, |
const FixedArray< T, N > & | R, | ||
double | precision | ||
) | [friend] |
Compare two arrays with limited precision.
The types might differ, but the length must be identical. The comparision loop is terminated at the first type mismatch.