Easy3D 2.5.3
|
Base class for vector types. It provides generic functionality for N
dimensional vectors.
More...
#include <easy3d/core/vec.h>
Public Types | |
typedef Vec< N, T > | thisclass |
typedef T | FT |
Public Member Functions | |
Vec () | |
Default constructor. All elements will be initialized to zero. | |
Vec (const T &s) | |
Constructs a vector from a scalar number s . All elements will be initialized to this value. | |
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. | |
size_t | dimension () const |
Returns the dimension/size of this vector. | |
size_t | size () const |
Returns the dimension/size of this 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, e.g.,. More... | |
operator T* () | |
Conversion operator returning the memory address of the data. Very convenient to pass this vector as a data pointer to functions, e.g.,. More... | |
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/magnitude0 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). | |
Base class for vector types. It provides generic functionality for N
dimensional vectors.
N | The dimension/size of a vector. |
T | The scalar type of vector elements. |
|
inline |
Conversion operator returning the constant memory address of the data. Very convenient to pass this vector as a data pointer to functions, e.g.,.
.
|
inline |
Conversion operator returning the memory address of the data. Very convenient to pass this vector as a data pointer to functions, e.g.,.
.