SeExpr
|
#include <Vec.h>
Classes | |
struct | INVALID_WITH_DIMENSION |
struct | INVALID_WITH_VECTOR_REFERENCE |
struct | INVALID_WITH_VECTOR_VALUE |
Public Types | |
typedef Vec< T, d, false > | T_VEC_VALUE |
typedef Vec< T, d, true > | T_VEC_REF |
Public Member Functions | |
Vec (T *raw, INVALID_WITH_VECTOR_VALUE u=(TYPENAME my_enable_if< ref, INVALID_WITH_VECTOR_VALUE >::TYPE())) | |
Initialize vector to be reference to plain raw data. | |
Vec (INVALID_WITH_VECTOR_REFERENCE u=(TYPENAME my_enable_if<!ref, INVALID_WITH_VECTOR_REFERENCE >::TYPE())) | |
Empty constructor (this is invalid for a reference type) | |
Vec (T v0, INVALID_WITH_VECTOR_REFERENCE u=(TYPENAME my_enable_if<!ref, INVALID_WITH_VECTOR_REFERENCE >::TYPE())) | |
Convenience constant vector initialization (valid for any d) | |
Vec (T v1, T v2, INVALID_WITH_VECTOR_REFERENCE u=(TYPENAME my_enable_if<!ref, INVALID_WITH_VECTOR_REFERENCE >::TYPE())) | |
Convenience 2 vector initialization (only for d==2) | |
Vec (T v1, T v2, T v3, INVALID_WITH_VECTOR_REFERENCE u=(TYPENAME my_enable_if<!ref, INVALID_WITH_VECTOR_REFERENCE >::TYPE())) | |
Convenience 3 vector initialization (only for d==3) | |
Vec (T v1, T v2, T v3, T v4, INVALID_WITH_VECTOR_REFERENCE u=(TYPENAME my_enable_if<!ref, INVALID_WITH_VECTOR_REFERENCE >::TYPE())) | |
Convenience 4 vector initialization (only for d==4) | |
template<class T2 , bool refother> | |
Vec (const Vec< T2, d, refother > &other, INVALID_WITH_VECTOR_REFERENCE u=(TYPENAME my_enable_if<!ref &&refother !=ref, INVALID_WITH_VECTOR_REFERENCE >::TYPE())) | |
Copy construct. Only valid if we are not going to be a reference data! | |
template<class T2 , bool refother> | |
Vec & | operator= (const Vec< T2, d, refother > &other) |
template<class Tother , bool refother> | |
bool | operator== (const Vec< Tother, d, refother > &other) const |
template<class Tother , bool refother> | |
bool | operator!= (const Vec< Tother, d, refother > &other) const |
T & | operator[] (const int i) |
const T & | operator[] (const int i) const |
T | length2 () const |
Square of euclidean (2) norm. | |
T | length () const |
Euclidean (2) norm. | |
T | normalize () |
Normalize in place and return the 2-norm before normalization. | |
Vec< T, d, false > | normalized () const |
Return a copy of the vector that is normalized. | |
Vec & | operator/= (const T val) |
Vec & | operator*= (const T val) |
template<bool refother> | |
Vec & | operator+= (const Vec< T, d, refother > &other) |
template<bool refother> | |
Vec & | operator-= (const Vec< T, d, refother > &other) |
template<bool refother> | |
Vec & | operator*= (const Vec< T, d, refother > &other) |
template<bool refother> | |
Vec & | operator/= (const Vec< T, d, refother > &other) |
T_VEC_VALUE | operator- () const |
template<bool refother> | |
bool | operator== (const Vec< T, d, refother > &other) const |
template<bool refother> | |
bool | operator!= (const Vec< T, d, refother > &other) const |
T_VEC_VALUE | operator* (T s) const |
T_VEC_VALUE | operator/ (T s) const |
template<bool refother> | |
T_VEC_VALUE | operator+ (const Vec< T, d, refother > &other) const |
template<bool refother> | |
T_VEC_VALUE | operator- (const Vec< T, d, refother > &other) const |
template<bool refother> | |
T_VEC_VALUE | operator* (const Vec< T, d, refother > &other) const |
template<bool refother> | |
T_VEC_VALUE | operator/ (const Vec< T, d, refother > &other) const |
template<bool refother> | |
T | dot (const Vec< T, d, refother > &o) const |
template<bool refother> | |
T_VEC_VALUE | cross (const Vec< T, 3, refother > &o) const |
T_VEC_VALUE | orthogonal () const |
template<bool refother> | |
T | angle (const Vec< T, 3, refother > &o) const |
template<bool refother> | |
T_VEC_VALUE | rotateBy (const Vec< T, 3, refother > &axis, T angle) const |
Static Public Member Functions | |
template<class T2 > | |
static Vec< T, d, false > | copy (T2 *raw, INVALID_WITH_VECTOR_REFERENCE u=(TYPENAME my_enable_if<!ref, INVALID_WITH_VECTOR_REFERENCE >::TYPE())) |
Initialize vector value using raw memory. | |
Private Attributes | |
static_if< ref, T *, T[d]>::TYPE | x |
internal data (either an explicit arary or a pointer to raw data) | |
Friends | |
T_VEC_VALUE | operator* (T s, const Vec &v) |
Vec class, generic dimension vector class can also point to data if the template argument ref is true
typedef Vec<T, d, true> SeExpr2::Vec< T, d, ref >::T_VEC_REF |
typedef Vec<T, d, false> SeExpr2::Vec< T, d, ref >::T_VEC_VALUE |
|
inlineexplicit |
|
inline |
|
inline |
Convenience constant vector initialization (valid for any d)
Definition at line 129 of file Vec.h.
References SeExpr2::Vec< T, d, ref >::x.
|
inline |
Convenience 2 vector initialization (only for d==2)
Definition at line 134 of file Vec.h.
References TYPENAME, and SeExpr2::Vec< T, d, ref >::x.
|
inline |
Convenience 3 vector initialization (only for d==3)
Definition at line 143 of file Vec.h.
References TYPENAME, and SeExpr2::Vec< T, d, ref >::x.
|
inline |
Convenience 4 vector initialization (only for d==4)
Definition at line 154 of file Vec.h.
References TYPENAME, and SeExpr2::Vec< T, d, ref >::x.
|
inline |
|
inline |
Returns the angle in radians between the current vector and the passed in vector.
Definition at line 354 of file Vec.h.
References SeExpr2::Vec< T, d, ref >::dot(), SeExpr2::Vec< T, d, ref >::length(), and TYPENAME.
Referenced by SeExpr2::Vec< T, d, ref >::rotateBy().
|
inlinestatic |
|
inline |
Cross product.
Definition at line 338 of file Vec.h.
References TYPENAME, and SeExpr2::Vec< T, d, ref >::x.
Referenced by SeExpr2::Vec< T, d, ref >::rotateBy().
|
inline |
Inner product.
Definition at line 330 of file Vec.h.
References SeExpr2::Reducer< T, d >::sum(), and SeExpr2::Vec< T, d, ref >::x.
Referenced by SeExpr2::Vec< T, d, ref >::angle(), SeExpr2::Vec< T, d, ref >::rotateBy(), SeExpr2::saturate(), SeExpr2::voronoi_f1_3d(), and SeExpr2::voronoi_f1f2_3d().
|
inline |
Euclidean (2) norm.
Definition at line 211 of file Vec.h.
References SeExpr2::Vec< T, d, ref >::length2().
Referenced by SeExpr2::Vec< T, d, ref >::angle(), SeExpr2::PrintFuncX::evalConstant(), SeExpr2::ExprStrSpec::match(), SeExpr2::SPrintFuncX::prep(), and SeExpr2::rotate().
|
inline |
Square of euclidean (2) norm.
Definition at line 204 of file Vec.h.
References SeExpr2::Reducer< T, d >::sum(), and SeExpr2::Vec< T, d, ref >::x.
Referenced by SeExpr2::Vec< T, d, ref >::length(), and SeExpr2::Vec< T, d, ref >::normalize().
|
inline |
Normalize in place and return the 2-norm before normalization.
Definition at line 214 of file Vec.h.
References SeExpr2::Vec< T, d, ref >::length2(), and SeExpr2::Vec< T, d, ref >::x.
Referenced by SeExpr2::Vec< T, d, ref >::normalized().
|
inline |
Return a copy of the vector that is normalized.
Definition at line 227 of file Vec.h.
References SeExpr2::Vec< T, d, ref >::normalize().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 239 of file Vec.h.
References SeExpr2::Vec< T, d, ref >::x.
|
inline |
Definition at line 257 of file Vec.h.
References SeExpr2::Vec< T, d, ref >::x.
|
inline |
|
inline |
Definition at line 245 of file Vec.h.
References SeExpr2::Vec< T, d, ref >::x.
|
inline |
|
inline |
|
inline |
Definition at line 251 of file Vec.h.
References SeExpr2::Vec< T, d, ref >::x.
|
inline |
|
inline |
|
inline |
Definition at line 233 of file Vec.h.
References SeExpr2::Vec< T, d, ref >::x.
|
inline |
Definition at line 263 of file Vec.h.
References SeExpr2::Vec< T, d, ref >::x.
|
inline |
Definition at line 180 of file Vec.h.
References SeExpr2::Vec< T, d, ref >::x.
|
inline |
Definition at line 275 of file Vec.h.
References SeExpr2::Vec< T, d, ref >::x.
|
inline |
Definition at line 186 of file Vec.h.
References SeExpr2::Vec< T, d, ref >::x.
|
inline |
Definition at line 198 of file Vec.h.
References SeExpr2::Vec< T, d, ref >::x.
|
inline |
Definition at line 201 of file Vec.h.
References SeExpr2::Vec< T, d, ref >::x.
|
inline |
Return a vector orthogonal to the current vector.
Definition at line 344 of file Vec.h.
References TYPENAME, and SeExpr2::Vec< T, d, ref >::x.
|
inline |
Returns the vector rotated by the angle given in radians about the given axis. (Axis must be normalized)
Definition at line 366 of file Vec.h.
References SeExpr2::Vec< T, d, ref >::angle(), SeExpr2::Vec< T, d, ref >::cross(), SeExpr2::Vec< T, d, ref >::dot(), sin(), and TYPENAME.
Referenced by SeExpr2::rotate(), and SeExpr2::up().
|
friend |
|
private |
internal data (either an explicit arary or a pointer to raw data)
Definition at line 105 of file Vec.h.
Referenced by SeExpr2::Vec< T, d, ref >::cross(), SeExpr2::Vec< T, d, ref >::dot(), SeExpr2::Curve< T >::getChannelValue(), SeExpr2::Curve< T >::getValue(), SeExpr2::Vec< T, d, ref >::length2(), SeExpr2::Vec< T, d, ref >::normalize(), SeExpr2::Vec< T, d, ref >::operator*=(), SeExpr2::Vec< T, d, ref >::operator*=(), SeExpr2::Vec< T, d, ref >::operator+=(), SeExpr2::Vec< T, d, ref >::operator-=(), SeExpr2::Vec< T, d, ref >::operator/=(), SeExpr2::Vec< T, d, ref >::operator/=(), SeExpr2::Vec< T, d, ref >::operator=(), SeExpr2::Vec< T, d, ref >::operator==(), SeExpr2::Vec< T, d, ref >::operator==(), SeExpr2::Vec< T, d, ref >::operator[](), SeExpr2::Vec< T, d, ref >::operator[](), SeExpr2::Vec< T, d, ref >::orthogonal(), SeExpr2::Vec< T, d, ref >::Vec(), SeExpr2::Vec< T, d, ref >::Vec(), SeExpr2::Vec< T, d, ref >::Vec(), and SeExpr2::Vec< T, d, ref >::Vec().