mi::math::Vector_struct<T, DIM> Struct Template Reference

Generic storage class template for math vector representations storing `DIM`

elements of type `T`

.
More...

`#include <vector.h>`

Inheritance diagram for mi::math::Vector_struct<T, DIM>:

## Public Attributes | |

T | elements [DIM] |

coordinates. More... | |

template<typename T, Size DIM>

struct mi::math::Vector_struct<T, DIM>

struct mi::math::Vector_struct<T, DIM>

Generic storage class template for math vector representations storing `DIM`

elements of type `T`

.

Used as base class for the mi::math::Vector class template.

Use the mi::math::Vector template in your programs and this storage class only if you need a POD type, for example for parameter passing.

This class template provides array-like storage for `DIM`

many values of a (arithmetic) type `T`

. It has specializations for `DIM`

== 1,2,3, and 4. These specializations use data members named `x`

, `y`

, `z`

, and `w`

according to the dimension. They provide users of the mi::math::Vector class template with the conventional member access to vector elements, such as in:

mi::math::Vector<mi::Float64,3> vec( 0.0);

vec.x = 4.0;

Fixed-size math vector class template with generic operations.

This class template contains only the data and no member functions. The necessary access abstraction is encoded in the free function mi::math::vector_base_ptr(), which is overloaded for the general case and the various specializations for the small dimensions. It returns a pointer to the first element.

- Include File:
`#include <mi/math/vector.h>`