55#if (_MSC_VER >= 1900 || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENVOLUMEMESH_VECTOR_LEGACY)
56#include "Vector11T.hh"
61#ifndef OPENVOLUMEMESH_VECTOR_HH
62#define OPENVOLUMEMESH_VECTOR_HH
72#if defined(__GNUC__) && defined(__SSE__)
79namespace OpenVolumeMesh {
96template<
typename Scalar,
int N>
class VectorDataT {
102#if defined(__GNUC__) && defined(__SSE__)
105template<>
class VectorDataT<float, 4> {
122#define TEMPLATE_HEADER template <typename Scalar, int N>
123#define CLASSNAME VectorT
124#define DERIVED VectorDataT<Scalar,N>
125#define unroll(expr) for (int i=0; i<N; ++i) expr(i)
132#include "VectorT_inc.hh"
135#undef TEMPLATE_HEADER
145#define TEMPLATE_HEADER template <typename Scalar>
146#define CLASSNAME VectorT<Scalar,DIM>
147#define DERIVED VectorDataT<Scalar,DIM>
151#define unroll(expr) expr(0) expr(1)
152#define unroll_comb(expr, op) expr(0) op expr(1)
153#define unroll_csv(expr) expr(0), expr(1)
154#include "VectorT_inc.hh"
161#define unroll(expr) expr(0) expr(1) expr(2)
162#define unroll_comb(expr, op) expr(0) op expr(1) op expr(2)
163#define unroll_csv(expr) expr(0), expr(1), expr(2)
164#include "VectorT_inc.hh"
171#define unroll(expr) expr(0) expr(1) expr(2) expr(3)
172#define unroll_comb(expr, op) expr(0) op expr(1) op expr(2) op expr(3)
173#define unroll_csv(expr) expr(0), expr(1), expr(2), expr(3)
174#include "VectorT_inc.hh"
181#define unroll(expr) expr(0) expr(1) expr(2) expr(3) expr(4)
182#define unroll_comb(expr, op) expr(0) op expr(1) op expr(2) op expr(3) op expr(4)
183#define unroll_csv(expr) expr(0), expr(1), expr(2), expr(3), expr(4)
184#include "VectorT_inc.hh"
191#define unroll(expr) expr(0) expr(1) expr(2) expr(3) expr(4) expr(5)
192#define unroll_comb(expr, op) expr(0) op expr(1) op expr(2) op expr(3) op expr(4) op expr(5)
193#define unroll_csv(expr) expr(0), expr(1), expr(2), expr(3), expr(4), expr(5)
194#include "VectorT_inc.hh"
201#undef TEMPLATE_HEADER
210inline VectorT<float,3>
214 VectorT<float,3>(values_[1]*_rhs.values_[2]-values_[2]*_rhs.values_[1],
215 values_[2]*_rhs.values_[0]-values_[0]*_rhs.values_[2],
216 values_[0]*_rhs.values_[1]-values_[1]*_rhs.values_[0]);
222inline VectorT<double,3>
226 VectorT<double,3>(values_[1]*_rhs.values_[2]-values_[2]*_rhs.values_[1],
227 values_[2]*_rhs.values_[0]-values_[0]*_rhs.values_[2],
228 values_[0]*_rhs.values_[1]-values_[1]*_rhs.values_[0]);
238template<
typename Scalar1,
typename Scalar2,
int N>
239inline VectorT<Scalar1,N> operator*(Scalar2 _s,
const VectorT<Scalar1,N>& _v) {
246template<
typename Scalar,
int N>
248dot(
const VectorT<Scalar,N>& _v1,
const VectorT<Scalar,N>& _v2) {
255template<
typename Scalar,
int N>
256inline VectorT<Scalar,N>
257cross(
const VectorT<Scalar,N>& _v1,
const VectorT<Scalar,N>& _v2) {
267typedef VectorT<signed char,1> Vec1c;
269typedef VectorT<unsigned char,1> Vec1uc;
271typedef VectorT<signed short int,1> Vec1s;
273typedef VectorT<unsigned short int,1> Vec1us;
275typedef VectorT<signed int,1> Vec1i;
277typedef VectorT<unsigned int,1> Vec1ui;
279typedef VectorT<float,1> Vec1f;
281typedef VectorT<double,1> Vec1d;
284typedef VectorT<signed char,2> Vec2c;
286typedef VectorT<unsigned char,2> Vec2uc;
288typedef VectorT<signed short int,2> Vec2s;
290typedef VectorT<unsigned short int,2> Vec2us;
292typedef VectorT<signed int,2> Vec2i;
294typedef VectorT<unsigned int,2> Vec2ui;
296typedef VectorT<float,2> Vec2f;
298typedef VectorT<double,2> Vec2d;
301typedef VectorT<signed char,3> Vec3c;
303typedef VectorT<unsigned char,3> Vec3uc;
305typedef VectorT<signed short int,3> Vec3s;
307typedef VectorT<unsigned short int,3> Vec3us;
309typedef VectorT<signed int,3> Vec3i;
311typedef VectorT<unsigned int,3> Vec3ui;
313typedef VectorT<float,3> Vec3f;
315typedef VectorT<double,3> Vec3d;
317typedef VectorT<bool,3> Vec3b;
320typedef VectorT<signed char,4> Vec4c;
322typedef VectorT<unsigned char,4> Vec4uc;
324typedef VectorT<signed short int,4> Vec4s;
326typedef VectorT<unsigned short int,4> Vec4us;
328typedef VectorT<signed int,4> Vec4i;
330typedef VectorT<unsigned int,4> Vec4ui;
332typedef VectorT<float,4> Vec4f;
334typedef VectorT<double,4> Vec4d;
337typedef VectorT<signed char, 5> Vec5c;
339typedef VectorT<unsigned char, 5> Vec5uc;
341typedef VectorT<signed short int, 5> Vec5s;
343typedef VectorT<unsigned short int, 5> Vec5us;
345typedef VectorT<signed int, 5> Vec5i;
347typedef VectorT<unsigned int, 5> Vec5ui;
349typedef VectorT<float, 5> Vec5f;
351typedef VectorT<double, 5> Vec5d;
354typedef VectorT<signed char,6> Vec6c;
356typedef VectorT<unsigned char,6> Vec6uc;
358typedef VectorT<signed short int,6> Vec6s;
360typedef VectorT<unsigned short int,6> Vec6us;
362typedef VectorT<signed int,6> Vec6i;
364typedef VectorT<unsigned int,6> Vec6ui;
366typedef VectorT<float,6> Vec6f;
368typedef VectorT<double,6> Vec6d;
374const std::string typeName();
376template <>
const std::string typeName<Geometry::Vec2f>();
377template <>
const std::string typeName<Geometry::Vec2d>();
378template <>
const std::string typeName<Geometry::Vec2i>();
379template <>
const std::string typeName<Geometry::Vec2ui>();
381template <>
const std::string typeName<Geometry::Vec3f>();
382template <>
const std::string typeName<Geometry::Vec3d>();
383template <>
const std::string typeName<Geometry::Vec3i>();
384template <>
const std::string typeName<Geometry::Vec3ui>();
386template <>
const std::string typeName<Geometry::Vec4f>();
387template <>
const std::string typeName<Geometry::Vec4d>();
388template <>
const std::string typeName<Geometry::Vec4i>();
389template <>
const std::string typeName<Geometry::Vec4ui>();
auto operator%(const VectorT< OtherScalar, DIM > &_rhs) const -> typename std::enable_if< DIM==3, VectorT< decltype(this->values_[0] *_rhs[0] - this->values_[0] *_rhs[0]), DIM > >::type
Definition: Vector11T.hh:362