|
|
| Vec () |
| | Default constructor. All elements will be initialized to zero.
|
| |
| | Vec (const T &s) |
| | Constructs a vector from a scalar number.
|
| |
|
template<class T2> |
| | Vec (const Vec< N, T2 > &rhs) |
| | Constructs a vector from another vector of the same dimension/size.
|
| |
|
template<class T2, size_t M> |
| | Vec (const Vec< M, T2 > &rhs) |
| | Constructs a vector from another vector of the same dimension/size.
|
| |
|
template<class T2> |
| | Vec (const T2 *rhs) |
| | Constructs a vector from an array of values.
|
| |
|
thisclass & | operator= (const thisclass &rhs) |
| | Assignment operator. It assigns the value of this vector from another vector.
|
| |
|
T * | data () |
| | Returns the memory address of the vector.
|
| |
|
const T * | data () const |
| | Returns the constant memory address of the vector.
|
| |
|
| operator const T * () const |
| | Conversion operator returning the constant memory address of the data. Very convenient to pass this vector as a data pointer to functions.
|
| |
|
| operator T* () |
| | Conversion operator returning the constant memory address of the data. Very convenient to pass this vector as a data pointer to functions.
|
| |
|
T | length2 () const |
| | Returns the squared length of this vector.
|
| |
|
T | length () const |
| | Returns the length of this vector.
|
| |
|
T | norm () const |
| | Returns the norm (i.e., length/magnitude) of this vector.
|
| |
|
T | distance2 (const thisclass &rhs) const |
| | Returns the squared Euclidean distance to another vector.
|
| |
|
thisclass & | normalize () |
| | Normalizes this vector.
|
| |
|
thisclass & | operator+= (const thisclass &v) |
| | Compound addition with another vector.
|
| |
|
thisclass & | operator-= (const thisclass &v) |
| | Compound subtraction with another vector.
|
| |
|
thisclass & | operator*= (const thisclass &v) |
| | Compound component-wise multiplication with another vector.
|
| |
|
thisclass & | operator/= (const thisclass &v) |
| | Compound component-wise division with another vector.
|
| |
|
template<class T2> |
| thisclass & | operator*= (T2 s) |
| | Compound vector-scalar multiplication.
|
| |
|
template<class T2> |
| thisclass & | operator/= (T2 s) |
| | Compound vector-scalar division.
|
| |
|
thisclass | operator+ (const thisclass &v) const |
| | Addition with another vector.
|
| |
|
thisclass | operator- (const thisclass &v) const |
| | Subtraction with another vector.
|
| |
|
template<class T2> |
| thisclass | operator* (T2 s) const |
| | Vector-scalar multiplication.
|
| |
|
template<class T2> |
| thisclass | operator/ (T2 s) const |
| | Vector-scalar division.
|
| |
|
thisclass | operator- () const |
| | Negates this vector (i.e., adds a minus sign).
|
| |
template<size_t N, class T>
class easy3d::Vec< N, T >
Base class for vector types. It provides generic functionality for N dimensional vectors.
- Template Parameters
-
| N | The dimension/size of a vector. |
| T | The scalar type of vector elements. |