Vector< N, T > Class Template Reference
[Utilities]
A vector.
More...
#include <Vector.h>
List of all members.
|
Public Member Functions |
| Vector () |
| Vector (T v) |
| Vector (Vector< N, T > const &other) |
T | get (size_t i) const |
void | set (size_t i, T v) |
size_t | getSize () const |
T & | at (size_t const i) |
T & | operator[] (size_t const i) |
Vector< N, T > & | operator= (Vector< N, T > const &other) |
Vector< N, T > & | operator+= (Vector< N, T > const &other) |
Vector< N, T > & | operator-= (Vector< N, T > const &other) |
Vector< N, T > & | operator*= (T s) |
Vector< N, T > & | operator/= (T s) |
Detailed Description
template<size_t N, typename T>
class Vector< N, T >
A vector.
A vector-class holding N elements of type T. To function properly T must support:
-
copy-con
-
operator=
-
operator+
-
operator-
-
operator*
-
operator/
Most frequent use will be Vector3d
Definition at line 25 of file Vector.h.
Constructor & Destructor Documentation
template<size_t N, typename T >
Initializes every item with default value
Definition at line 99 of file Vector.h.
template<size_t N, typename T >
Initializes every item with v
- Parameters:
-
| v | Default value for every item |
Definition at line 107 of file Vector.h.
template<size_t N, typename T >
Copy-Constructor
- Parameters:
-
Definition at line 115 of file Vector.h.
Member Function Documentation
template<size_t N, typename T >
T & Vector< N, T >::at |
( |
size_t const |
i |
) |
[inline] |
Get reference to element at position i
- Parameters:
-
| i | Position of the element |
- Returns:
- A reference to the element
Definition at line 149 of file Vector.h.
template<size_t N, typename T >
T Vector< N, T >::get |
( |
size_t |
i |
) |
const [inline] |
- Returns:
- Element at positon i or 0 if i not in range
Definition at line 123 of file Vector.h.
template<size_t N, typename T >
size_t Vector< N, T >::getSize |
( |
|
) |
const [inline] |
template<size_t N, typename T >
Vector< N, T > & Vector< N, T >::operator*= |
( |
T |
s |
) |
[inline] |
- Parameters:
-
| s | Scalar to multiply with |
Definition at line 192 of file Vector.h.
template<size_t N, typename T >
template<size_t N, typename T >
template<size_t N, typename T >
Vector< N, T > & Vector< N, T >::operator/= |
( |
T |
s |
) |
[inline] |
- Parameters:
-
| s | Scalat to divide through |
Definition at line 201 of file Vector.h.
template<size_t N, typename T >
Assignment-operator
- Parameters:
-
Definition at line 162 of file Vector.h.
template<size_t N, typename T >
T& Vector< N, T >::operator[] |
( |
size_t const |
i |
) |
[inline] |
Array-style access of elements
- Parameters:
-
| i | Position of the element |
- Returns:
- A reference to the element
Definition at line 70 of file Vector.h.
template<size_t N, typename T >
void Vector< N, T >::set |
( |
size_t |
i, |
|
|
T |
v | |
|
) |
| | [inline] |
Sets element at position i to v. Does nothing if i is out of range.
- Parameters:
-
| i | Position of element to be set |
| v | Value to be set |
Definition at line 136 of file Vector.h.
The documentation for this class was generated from the following file: