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
69 #include <OpenMesh/Core/System/config.h>
75 #if defined(__GNUC__) && defined(__SSE__)
76 #include <xmmintrin.h>
97 template<
typename Scalar,
int N>
class VectorDataT {
103 #if defined(__GNUC__) && defined(__SSE__)
106 template<>
class VectorDataT<float, 4> {
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>
322 template<
typename Scalar,
int DIM>
330 template<
typename Scalar,
int DIM>
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:59
VectorT< signed char, 3 > Vec3c
3-byte signed vector
Definition: Vector11T.hh:838
VectorT< double, 3 > Vec3d
3-double vector
Definition: Vector11T.hh:852
VectorT< signed int, 1 > Vec1i
1-int signed vector
Definition: Vector11T.hh:812
VectorT< unsigned char, 5 > Vec5uc
5-byte unsigned vector
Definition: Vector11T.hh:876
VectorT< unsigned int, 2 > Vec2ui
2-int unsigned vector
Definition: Vector11T.hh:831
VectorT< double, 1 > Vec1d
1-double vector
Definition: Vector11T.hh:818
VectorT< double, 4 > Vec4d
4-double vector
Definition: Vector11T.hh:871
VectorT< float, 2 > Vec2f
2-float vector
Definition: Vector11T.hh:833
VectorT< signed short int, 3 > Vec3s
3-short signed vector
Definition: Vector11T.hh:842
VectorT< double, 2 > Vec2d
2-double vector
Definition: Vector11T.hh:835
VectorT< signed int, 5 > Vec5i
5-int signed vector
Definition: Vector11T.hh:882
VectorT< signed char, 4 > Vec4c
4-byte signed vector
Definition: Vector11T.hh:857
VectorT< signed char, 5 > Vec5c
5-byte signed vector
Definition: Vector11T.hh:874
VectorT< unsigned int, 5 > Vec5ui
5-int unsigned vector
Definition: Vector11T.hh:884
VectorT< signed short int, 5 > Vec5s
5-short signed vector
Definition: Vector11T.hh:878
VectorT< unsigned int, 4 > Vec4ui
4-int unsigned vector
Definition: Vector11T.hh:867
VectorT< unsigned short int, 3 > Vec3us
3-short unsigned vector
Definition: Vector11T.hh:844
VectorT< unsigned char, 3 > Vec3uc
3-byte unsigned vector
Definition: Vector11T.hh:840
VectorT< signed short int, 2 > Vec2s
2-short signed vector
Definition: Vector11T.hh:825
VectorT< signed int, 2 > Vec2i
2-int signed vector
Definition: Vector11T.hh:829
auto operator*(const OtherScalar &_s, const VectorT< Scalar, DIM > &rhs) -> decltype(rhs.operator*(_s))
Component wise multiplication from the left.
Definition: Vector11T.hh:692
VectorT< signed char, 2 > Vec2c
2-byte signed vector
Definition: Vector11T.hh:821
VectorT< unsigned short int, 2 > Vec2us
2-short unsigned vector
Definition: Vector11T.hh:827
VectorT< signed char, 6 > Vec6c
6-byte signed vector
Definition: Vector11T.hh:891
VectorT< signed int, 6 > Vec6i
6-int signed vector
Definition: Vector11T.hh:899
VectorT< signed int, 4 > Vec4i
4-int signed vector
Definition: Vector11T.hh:865
VectorT< signed short int, 4 > Vec4s
4-short signed vector
Definition: Vector11T.hh:861
VectorT< unsigned char, 6 > Vec6uc
6-byte unsigned vector
Definition: Vector11T.hh:893
VectorT< float, 6 > Vec6f
6-float vector
Definition: Vector11T.hh:903
VectorT< float, 5 > Vec5f
5-float vector
Definition: Vector11T.hh:886
VectorT< unsigned char, 2 > Vec2uc
2-byte unsigned vector
Definition: Vector11T.hh:823
VectorT< unsigned int, 6 > Vec6ui
6-int unsigned vector
Definition: Vector11T.hh:901
VectorT< float, 4 > Vec4f
4-float vector
Definition: Vector11T.hh:869
VectorT< unsigned char, 1 > Vec1uc
1-byte unsigned vector
Definition: Vector11T.hh:806
VectorT< unsigned char, 4 > Vec4uc
4-byte unsigned vector
Definition: Vector11T.hh:859
VectorT< unsigned short int, 1 > Vec1us
1-short unsigned vector
Definition: Vector11T.hh:810
VectorT< float, 1 > Vec1f
1-float vector
Definition: Vector11T.hh:816
VectorT< double, 6 > Vec6d
6-double vector
Definition: Vector11T.hh:905
VectorT< signed short int, 1 > Vec1s
1-short signed vector
Definition: Vector11T.hh:808
VectorT< bool, 3 > Vec3b
3-bool vector
Definition: Vector11T.hh:854
VectorT< unsigned int, 1 > Vec1ui
1-int unsigned vector
Definition: Vector11T.hh:814
VectorT< signed char, 1 > Vec1c
1-byte signed vector
Definition: Vector11T.hh:804
VectorT< double, 5 > Vec5d
5-double vector
Definition: Vector11T.hh:888
VectorT< unsigned short int, 4 > Vec4us
4-short unsigned vector
Definition: Vector11T.hh:863
VectorT< unsigned int, 3 > Vec3ui
3-int unsigned vector
Definition: Vector11T.hh:848
VectorT< unsigned short int, 6 > Vec6us
6-short unsigned vector
Definition: Vector11T.hh:897
VectorT< unsigned short int, 5 > Vec5us
5-short unsigned vector
Definition: Vector11T.hh:880
VectorT< float, 3 > Vec3f
3-float vector
Definition: Vector11T.hh:850
VectorT< signed short int, 6 > Vec6s
6-short signed vector
Definition: Vector11T.hh:895
VectorT< signed int, 3 > Vec3i
3-int signed vector
Definition: Vector11T.hh:846
VectorT< Scalar, DIM > & normalize(VectorT< Scalar, DIM > &_v)
non-member normalize
Definition: Vector11T.hh:768
Scalar dot(const VectorT< Scalar, DIM > &_v1, const VectorT< Scalar, DIM > &_v2)
symmetric version of the dot product
Definition: Vector11T.hh:724
VectorT< Scalar, DIM > & minimize(VectorT< Scalar, DIM > &_v1, VectorT< Scalar, DIM > &_v2)
non-member minimize
Definition: Vector11T.hh:782
VectorT< Scalar, DIM > & vectorize(VectorT< Scalar, DIM > &_v, OtherScalar const &_val)
non-member vectorize
Definition: Vector11T.hh:761
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
cross product: only defined for Vec3* as specialization
Definition: Vector11T.hh:374
VectorT< Scalar, DIM > min(const VectorT< Scalar, DIM > &_v1, const VectorT< Scalar, DIM > &_v2)
non-member min
Definition: Vector11T.hh:796
Scalar sqrnorm(const VectorT< Scalar, DIM > &_v)
non-member sqrnorm
Definition: Vector11T.hh:755
auto cross(const VectorT< LScalar, DIM > &_v1, const VectorT< RScalar, DIM > &_v2) -> decltype(_v1 % _v2)
symmetric version of the cross product
Definition: Vector11T.hh:732
VectorT< Scalar, DIM > & maximize(VectorT< Scalar, DIM > &_v1, VectorT< Scalar, DIM > &_v2)
non-member maximize
Definition: Vector11T.hh:775
VectorT< Scalar, DIM > max(const VectorT< Scalar, DIM > &_v1, const VectorT< Scalar, DIM > &_v2)
non-member max
Definition: Vector11T.hh:789
Scalar norm(const VectorT< Scalar, DIM > &_v)
non-member norm
Definition: Vector11T.hh:748
Definition: VectorT_inc.hh:68
vector_type & minimize(const vector_type &_rhs)
minimize values: same as *this = min(*this, _rhs), but faster
Definition: VectorT_inc.hh:547
Scalar norm() const
compute euclidean norm
Definition: VectorT_inc.hh:410
VectorT< Scalar, 3 > operator%(const VectorT< Scalar, 3 > &_rhs) const
cross product: only defined for Vec3* as specialization
Scalar sqrnorm() const
compute squared euclidean norm
Definition: VectorT_inc.hh:414
vector_type & maximize(const vector_type &_rhs)
maximize values: same as *this = max(*this, _rhs), but faster
Definition: VectorT_inc.hh:564
vector_type & vectorize(const Scalar &_s)
store the same value in each component (e.g. to clear all entries)
Definition: VectorT_inc.hh:605
vector_type & normalize()
normalize vector, return normalized vector
Definition: VectorT_inc.hh:432