58 #if ((defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENMESH_VECTOR_LEGACY) 59 #include "Vector11T.hh" 63 #ifndef OPENMESH_VECTOR_HH 64 #define OPENMESH_VECTOR_HH 75 #if defined(__GNUC__) && defined(__SSE__) 76 #include <xmmintrin.h> 103 #if defined(__GNUC__) && defined(__SSE__) 123 #define TEMPLATE_HEADER template <typename Scalar, int N> 124 #define CLASSNAME VectorT 125 #define DERIVED VectorDataT<Scalar,N> 126 #define unroll(expr) for (int i=0; i<N; ++i) expr(i) 133 #include "VectorT_inc.hh" 136 #undef TEMPLATE_HEADER 145 #if OM_PARTIAL_SPECIALIZATION 148 #define TEMPLATE_HEADER template <typename Scalar> 149 #define CLASSNAME VectorT<Scalar,DIM> 150 #define DERIVED VectorDataT<Scalar,DIM> 154 #define unroll(expr) expr(0) expr(1) 155 #define unroll_comb(expr, op) expr(0) op expr(1) 156 #define unroll_csv(expr) expr(0), expr(1) 157 #include "VectorT_inc.hh" 165 #define unroll(expr) expr(0) expr(1) expr(2) 166 #define unroll_comb(expr, op) expr(0) op expr(1) op expr(2) 167 #define unroll_csv(expr) expr(0), expr(1), expr(2) 168 #include "VectorT_inc.hh" 176 #define unroll(expr) expr(0) expr(1) expr(2) expr(3) 177 #define unroll_comb(expr, op) expr(0) op expr(1) op expr(2) op expr(3) 178 #define unroll_csv(expr) expr(0), expr(1), expr(2), expr(3) 179 #include "VectorT_inc.hh" 186 #define unroll(expr) expr(0) expr(1) expr(2) expr(3) expr(4) 187 #define unroll_comb(expr, op) expr(0) op expr(1) op expr(2) op expr(3) op expr(4) 188 #define unroll_csv(expr) expr(0), expr(1), expr(2), expr(3), expr(4) 189 #include "VectorT_inc.hh" 196 #define unroll(expr) expr(0) expr(1) expr(2) expr(3) expr(4) expr(5) 197 #define unroll_comb(expr, op) expr(0) op expr(1) op expr(2) op expr(3) op expr(4) op expr(5) 198 #define unroll_csv(expr) expr(0), expr(1), expr(2), expr(3), expr(4), expr(5) 199 #include "VectorT_inc.hh" 206 #undef TEMPLATE_HEADER 223 values_[2]*_rhs.values_[0]-values_[0]*_rhs.values_[2],
224 values_[0]*_rhs.values_[1]-values_[1]*_rhs.values_[0]);
235 values_[2]*_rhs.values_[0]-values_[0]*_rhs.values_[2],
236 values_[0]*_rhs.values_[1]-values_[1]*_rhs.values_[0]);
248 template<
typename Scalar1,
typename Scalar2,
int N>
256 template<
typename Scalar,
int N>
265 template<
typename Scalar,
int N>
274 template<
typename Scalar,
int DIM>
282 template<
typename Scalar,
int DIM>
290 template<
typename Scalar,
int DIM,
typename OtherScalar>
298 template<
typename Scalar,
int DIM>
306 template<
typename Scalar,
int DIM>
314 template<
typename Scalar,
int DIM>
432 #endif // OPENMESH_VECTOR_HH defined vector_type & maximize(const vector_type &_rhs)
maximize values: same as *this = max(*this, _rhs), but faster
VectorT< signed int, 6 > Vec6i
VectorT< signed char, 5 > Vec5c
VectorT< unsigned short int, 5 > Vec5us
VectorT< unsigned char, 1 > Vec1uc
VectorT< signed int, 2 > Vec2i
VectorT< double, 1 > Vec1d
VectorT< unsigned int, 1 > Vec1ui
Scalar sqrnorm(const VectorT< Scalar, DIM > &_v)
VectorT< unsigned char, 5 > Vec5uc
vector_type & vectorize(const Scalar &_s)
store the same value in each component (e.g. to clear all entries)
auto norm() const -> decltype(std::sqrt(std::declval< VectorT< S, DIM >>().sqrnorm()))
compute euclidean norm
VectorT< float, 4 > Vec4f
VectorT< double, 6 > Vec6d
VectorT< signed short int, 2 > Vec2s
decltype(std::declval< S >() *std::declval< S >()) sqrnorm() const
compute squared euclidean norm
Scalar norm(const VectorT< Scalar, DIM > &_v)
VectorT< float, 3 > Vec3f
VectorT< Scalar, DIM > & normalize(VectorT< Scalar, DIM > &_v)
VectorT< double, 4 > Vec4d
VectorT< unsigned short int, 4 > Vec4us
VectorT< unsigned int, 6 > Vec6ui
auto normalize() -> decltype(*this/=std::declval< VectorT< S, DIM >>().norm())
VectorT< unsigned char, 2 > Vec2uc
VectorT< signed short int, 3 > Vec3s
VectorT< unsigned short int, 3 > Vec3us
VectorT< float, 2 > Vec2f
VectorT< unsigned char, 3 > Vec3uc
VectorT< signed short int, 5 > Vec5s
VectorT< unsigned int, 4 > Vec4ui
VectorT< float, 6 > Vec6f
VectorT< signed char, 2 > Vec2c
VectorT< Scalar1, N > operator*(Scalar2 _s, const VectorT< Scalar1, N > &_v)
VectorT< signed char, 1 > Vec1c
VectorT< unsigned int, 2 > Vec2ui
VectorT< signed char, 6 > Vec6c
VectorT< unsigned int, 5 > Vec5ui
VectorT< double, 5 > Vec5d
VectorT< Scalar, DIM > & maximize(VectorT< Scalar, DIM > &_v1, VectorT< Scalar, DIM > &_v2)
VectorT< signed int, 3 > Vec3i
VectorT< float, 5 > Vec5f
VectorT< unsigned short int, 6 > Vec6us
Scalar dot(const VectorT< Scalar, N > &_v1, const VectorT< Scalar, N > &_v2)
VectorT< signed int, 4 > Vec4i
VectorT< float, 1 > Vec1f
VectorT< unsigned char, 4 > Vec4uc
VectorT< unsigned short int, 2 > Vec2us
VectorT< unsigned short int, 1 > Vec1us
VectorT< signed int, 1 > Vec1i
vector_type & minimize(const vector_type &_rhs)
minimize values: same as *this = min(*this, _rhs), but faster
VectorT< double, 3 > Vec3d
VectorT< unsigned int, 3 > Vec3ui
VectorT< signed short int, 1 > Vec1s
VectorT< signed short int, 4 > Vec4s
VectorT< signed char, 3 > Vec3c
VectorT< unsigned char, 6 > Vec6uc
VectorT< signed short int, 6 > Vec6s
VectorT< signed int, 5 > Vec5i
auto operator%(const VectorT< OtherScalar, DIM > &_rhs) const -> typename std::enable_if< DIM==3, VectorT< decltype((*this)[0] *_rhs[0] -(*this)[0] *_rhs[0]), DIM >>::type
VectorT< Scalar, N > cross(const VectorT< Scalar, N > &_v1, const VectorT< Scalar, N > &_v2)
VectorT< double, 2 > Vec2d
VectorT< Scalar, DIM > & vectorize(VectorT< Scalar, DIM > &_v, OtherScalar const &_val)
VectorT< signed char, 4 > Vec4c
VectorT< Scalar, DIM > & minimize(VectorT< Scalar, DIM > &_v1, VectorT< Scalar, DIM > &_v2)