VectorXD.h
Go to the documentation of this file.
1 #ifndef __GfxTL_VECTORXD_HEADER__
2 #define __GfxTL_VECTORXD_HEADER__
3 #include <assert.h>
4 #ifndef _USE_MATH_DEFINES
5 #define _USE_MATH_DEFINES
6 #endif
7 #include <cmath>
8 #include <memory.h>
9 #include <GfxTL/MatrixXX.h>
10 #include <GfxTL/MathHelper.h>
11 #include <GfxTL/NullClass.h>
12 #include <GfxTL/StdOverrides.h>
13 #include <iostream>
14 #include <algorithm>
15 
16 
17 namespace GfxTL
18 {
19  template< unsigned int D, class T >
20  class VectorXD
21  : public MatrixXX< 1, D, T >
22  {
23  public:
24  typedef T ScalarType;
25  typedef T value_type;
28 
29  enum
30  {
31  Dim = D
32  };
33 
34  VectorXD() {}
35 
37  : SuperType(v)
38  {}
39 
40  explicit VectorXD(const T* v)
41  {
42  memcpy(SuperType::_m, v, sizeof(SuperType::_m));
43  }
44 
45  template< class S >
46  explicit VectorXD(const S* v)
47  {
48  for (unsigned int i = 0; i < Dim; ++i)
49  {
50  SuperType::_m[i] = (T)v[i];
51  }
52  }
53 
54  template< class S >
55  explicit VectorXD(const VectorXD< D, S >& v)
56  {
57  for (unsigned int i = 0; i < Dim; ++i)
58  {
59  SuperType::_m[i] = (T)v[i];
60  }
61  }
62 
64  : SuperType(s)
65  {}
66 
67  explicit VectorXD(T x)
68  {
69  for (unsigned int i = 0; i < Dim; ++i)
70  {
71  SuperType::_m[i] = x;
72  }
73  }
74 
75  template< class S >
76  explicit VectorXD(const S x,
77  typename std::enable_if< std::is_convertible< S, ScalarType >::value, NullClass >::type& dummy = *((NullClass*)0))
78  {
79  for (unsigned int i = 0; i < Dim; ++i)
80  {
81  SuperType::_m[i] = ScalarType(x);
82  }
83  }
84 
85  template< unsigned int X >
86  explicit VectorXD(const VectorXD< X, T >& vec)
87  {
88  for (unsigned int i = 0; i < std::min(D, X); ++i)
89  {
90  SuperType::_m[i] = vec[i];
91  }
92  for (unsigned int i = X; i < D; ++i)
93  {
94  SuperType::_m[i] = 0;
95  }
96  }
97 
98  explicit VectorXD(const VectorXD < D - 1, T > &v, T s)
99  {
100  for (unsigned int i = 0; i < D - 1; ++i)
101  {
102  SuperType::_m[i] = v[i];
103  }
104  SuperType::_m[D - 1] = s;
105  }
106 
107  explicit VectorXD(const VectorXD < D - 2, T > &v, T s, T s2)
108  {
109  for (unsigned int i = 0; i < D - 2; ++i)
110  {
111  SuperType::_m[i] = v[i];
112  }
113  SuperType::_m[D - 2] = s;
114  SuperType::_m[D - 1] = s2;
115  }
116 
117  explicit VectorXD(const VectorXD < D - 3, T > &v, T s, T s2, T s3)
118  {
119  for (unsigned int i = 0; i < D - 2; ++i)
120  {
121  SuperType::_m[i] = v[i];
122  }
123  SuperType::_m[D - 3] = s;
124  SuperType::_m[D - 2] = s2;
125  SuperType::_m[D - 1] = s3;
126  }
127 
128  VectorXD(T x, T y)
129  {
130 #ifdef WIN32
132 #endif
133  SuperType::_m[0] = x;
134  SuperType::_m[1] = y;
135  }
136 
137  VectorXD(T x, T y, T z)
138  {
139 #ifdef WIN32
141 #endif
142  SuperType::_m[0] = x;
143  SuperType::_m[1] = y;
144  SuperType::_m[2] = z;
145  }
146 
147  VectorXD(T x, T y, T z, T w)
148  {
149 #ifdef WIN32
151 #endif
152  SuperType::_m[0] = x;
153  SuperType::_m[1] = y;
154  SuperType::_m[2] = z;
155  SuperType::_m[3] = w;
156  }
157 
159  {
160  return (ThisType&)
162  }
163 
165  {
166  return (ThisType&)
168  }
169 
170  template< class S >
172  {
173  for (unsigned int i = 0; i < D; ++i)
174  {
175  SuperType::_m[i] = (T)v[0][i];
176  }
177  return *this;
178  }
179 
180  inline ScalarType& operator[](unsigned int i)
181  {
182  return SuperType::_m[i];
183  }
184 
185  inline ScalarType operator[](unsigned int i) const
186  {
187  return SuperType::_m[i];
188  }
189 
190  /*operator ScalarType *()
191  {
192  return SuperType::_m;
193  }
194 
195  operator const ScalarType *() const
196  {
197  return SuperType::_m;
198  }*/
199 
201  {
202  for (unsigned int i = 0; i < D; ++i)
203  {
204  SuperType::_m[i] += a.Data()[i];
205  }
206  return *this;
207  }
208 
210  {
211  for (unsigned int i = 0; i < D; ++i)
212  {
213  SuperType::_m[i] -= a.Data()[i];
214  }
215  return *this;
216  }
217 
218  template< class S >
220  {
221  for (unsigned int i = 0; i < D; ++i)
222  {
223  SuperType::_m[i] *= s;
224  }
225  return *this;
226  }
227 
228  template< class S >
230  {
231  for (unsigned int i = 0; i < D; ++i)
232  {
233  SuperType::_m[i] /= s;
234  }
235  return *this;
236  }
237 
239  {
240  return ScalarType(-1) * (*this);
241  }
242 
244  {
245  return sqrt(SqrLength());
246  }
247 
249  {
250  ScalarType s = 0;
251  for (unsigned int i = 0; i < D; ++i)
252  {
253  s += SuperType::_m[i] * SuperType::_m[i];
254  }
255  return s;
256  }
257 
259  {
260  ScalarType s = 0;
261  for (unsigned int i = 0; i < D; ++i)
262  {
263  s += abs(SuperType::_m[i]);
264  }
265  return s;
266  }
267 
268  void Zero()
269  {
270  memset(SuperType::_m, 0, sizeof(SuperType::_m));
271  }
272 
273  bool operator==(const VectorXD< D, T >& a) const
274  {
275  return memcmp(SuperType::_m, a._m, sizeof(SuperType::_m)) == 0;
276  }
277 
279  {
280  ScalarType diff, d;
281  diff = SuperType::_m[0] - v[0];
282  d = diff * diff;
283  for (unsigned int i = 1; i < Dim; ++i)
284  {
285  diff = SuperType::_m[i] - v[i];
286  d += diff * diff;
287  }
288  return d;
289  }
290 
292  {
293  return sqrt(SqrDistance(v));
294  }
295 
297  {
298  ScalarType d = Math< ScalarType >::Abs(SuperType::_m[0] - v[0]);
299  for (unsigned int i = 1; i < Dim; ++i)
300  {
301  d += Math< ScalarType >::Abs(SuperType::_m[i] - v[i]);
302  }
303  return d;
304  }
305 
307  {
308  ScalarType d = Math< ScalarType >::Abs(SuperType::_m[0] - v[0]),
309  di;
310  for (unsigned int i = 1; i < Dim; ++i)
311  {
312  di = Math< ScalarType >::Abs(SuperType::_m[i] - v[i]);
313  if (di > d)
314  {
315  d = di;
316  }
317  }
318  return d;
319  }
320 
322  {
324  for (unsigned int i = 0; i < Dim; ++i)
325  {
326  p[i] = SuperType::_m[i];
327  }
328  p[Dim] = 1;
329  return p;
330  }
331 
333  typedef const ScalarType* const_iterator;
334 
336  {
337  return SuperType::_m;
338  }
340  {
341  return SuperType::_m + D;
342  }
343  const ScalarType* begin() const
344  {
345  return SuperType::_m;
346  }
347  const ScalarType* end() const
348  {
349  return SuperType::_m + D;
350  }
351  };
352 
353  template< unsigned int D, class T >
354  std::ostream& operator<<(std::ostream& o, const VectorXD< D, T >& vec)
355  {
356  o << "[";
357  for (unsigned int i = 0; i < D; ++i)
358  {
359  o << vec[i];
360  if (i < D - 1)
361  {
362  o << ", ";
363  }
364  }
365  o << "]";
366  return o;
367  }
368 
369  template< unsigned int D, class T >
371  const VectorXD< D, T >& b)
372  {
374  for (unsigned int i = 0; i < D; ++i)
375  {
376  v[i] = a[i] + b[i];
377  }
378  return v;
379  }
380 
381  template< class T >
383  const VectorXD< 1, T >& b)
384  {
385  return VectorXD< 1, T >(a[0] + b[0]);
386  }
387 
388  template< class T >
390  const VectorXD< 2, T >& b)
391  {
392  return VectorXD< 2, T >(a[0] + b[0], a[1] + b[1]);
393  }
394 
395  template< class T >
397  const VectorXD< 3, T >& b)
398  {
399  return VectorXD< 3, T >(a[0] + b[0], a[1] + b[1], a[2] + b[2]);
400  }
401 
402  template< class T >
404  const VectorXD< 4, T >& b)
405  {
406  return VectorXD< 4, T >(a[0] + b[0], a[1] + b[1], a[2] + b[2],
407  a[3] + b[3]);
408  }
409 
410  template< unsigned int D, class T >
412  const VectorXD< D, T >& b)
413  {
415  for (unsigned int i = 0; i < D; ++i)
416  {
417  v[i] = a[i] - b[i];
418  }
419  return v;
420  }
421 
422  template< class T >
424  const VectorXD< 1, T >& b)
425  {
426  return VectorXD< 1, T >(a[0] - b[0]);
427  }
428 
429  template< class T >
431  const VectorXD< 2, T >& b)
432  {
433  return VectorXD< 2, T >(a[0] - b[0], a[1] - b[1]);
434  }
435 
436  template< class T >
438  const VectorXD< 3, T >& b)
439  {
440  return VectorXD< 3, T >(a[0] - b[0], a[1] - b[1], a[2] - b[2]);
441  }
442 
443  template< class T >
445  const VectorXD< 4, T >& b)
446  {
447  return VectorXD< 4, T >(a[0] - b[0], a[1] - b[1], a[2] - b[2],
448  a[3] - b[3]);
449  }
450 
451  // scalar product (inner product)
452  template< unsigned int D, class T >
454  const VectorXD< D, T >& b)
455  {
456  typename VectorXD< D, T >::ScalarType retVal = a[0] * b[0];
457  for (unsigned int i = 1; i < D; ++i)
458  {
459  retVal += a[i] * b[i];
460  }
461  return retVal;
462  }
463 
464  // outer product
465  template< unsigned int A, unsigned int B, class T >
467  {
469  for (unsigned int c = 0; c < B; ++c)
470  for (unsigned int r = 0; r < A; ++r)
471  {
472  m[c][r] = a[r] * b[c];
473  }
474  return m;
475  }
476 
477  template< unsigned int D, class T >
479  {
481  for (unsigned int c = 0; c < D; ++c)
482  {
483  m[c][c] = a[c] * a[c];
484  for (unsigned int r = c + 1; r < D; ++r)
485  {
486  m[c][r] = a[r] * a[c];
487  m[r][c] = m[c][r];
488  }
489  }
490  return m;
491  }
492 
493  template< class T >
495  const VectorXD< 1, T >& b)
496  {
497  return a[0] * b[0];
498  }
499 
500  template< class T >
502  const VectorXD< 2, T >& b)
503  {
504  return a[0] * b[0] + a[1] * b[1];
505  }
506 
507  template< class T >
509  const VectorXD< 3, T >& b)
510  {
511  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
512  }
513 
514  template< class T >
516  const VectorXD< 4, T >& b)
517  {
518  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
519  }
520 
521  template< unsigned int D, class T >
523  {
525  for (unsigned int i = 0; i < D; ++i)
526  {
527  v[i] = s * a[i];
528  }
529  return v;
530  }
531 
532  template< class T >
534  {
535  return VectorXD< 1, T >(s * a[0]);
536  }
537 
538  template< class T >
540  {
541  return VectorXD< 2, T >(s * a[0], s * a[1]);
542  }
543 
544  template< class T >
546  {
547  return VectorXD< 3, T >(s * a[0], s * a[1], s * a[2]);
548  }
549 
550  template< class T >
552  {
553  return VectorXD< 4, T >(s * a[0], s * a[1], s * a[2],
554  s * a[3]);
555  }
556 
557  template< unsigned int D, class T >
559  {
561  for (unsigned int i = 0; i < D; ++i)
562  {
563  v[i] = a[i] * s;
564  }
565  return v;
566  }
567 
568  template< class T >
570  {
571  return VectorXD< 1, T >(a[0] * s);
572  }
573 
574  template< class T >
576  {
577  return VectorXD< 2, T >(a[0] * s, a[1] * s);
578  }
579 
580  template< class T >
582  {
583  return VectorXD< 3, T >(a[0] * s, a[1] * s, a[2] * s);
584  }
585 
586  template< class T >
588  {
589  return VectorXD< 4, T >(a[0] * s, a[1] * s, a[2] * s,
590  a[3] * s);
591  }
592 
593  template< unsigned int D, class T >
595  {
597  for (unsigned int i = 0; i < D; ++i)
598  {
599  v[i] = a[i] / s;
600  }
601  return v;
602  }
603 
604  template< class T >
606  {
607  return VectorXD< 1, T >(a[0] / s);
608  }
609 
610  template< class T >
612  {
613  return VectorXD< 2, T >(a[0] / s, a[1] / s);
614  }
615 
616  template< class T >
618  {
619  return VectorXD< 3, T >(a[0] / s, a[1] / s, a[2] / s);
620  }
621 
622  template< class T >
624  {
625  return VectorXD< 4, T >(a[0] / s, a[1] / s, a[2] / s,
626  a[3] / s);
627  }
628 
629  template< class T >
631  const VectorXD< 3, T >& b)
632  {
633  return VectorXD< 3, T >(a[1] * b[2] - b[1] * a[2],
634  a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]);
635  }
636 
637  template< unsigned int D, class T >
639  {
640  using namespace std;
642  for (unsigned int r = 0; r < D; ++r)
643  {
644  m[r] = min(a[r], b[r]);
645  }
646  return m;
647  }
648 
649  template< unsigned int D, class T >
651  {
652  using namespace std;
654  for (unsigned int r = 0; r < D; ++r)
655  {
656  m[r] = max(a[r], b[r]);
657  }
658  return m;
659  }
660 
661  template< unsigned int D, class T >
663  {
665  for (unsigned int i = 0; i < D; ++i)
666  {
667  v[i] = sqrt(a[i]);
668  }
669  return v;
670  }
671 
680 
705 
706  template< class T >
708  : public VectorXD< 4, T >
709  {
710  public:
711  typedef T ScalarType;
713 
715  {}
716 
717  Quaternion(T w, T x, T y, T z)
718  : VectorXD< 4, T >(w, x, y, z)
719  {}
720 
722  {
723  Quaternion q = (*this) * b;
724  *this = q;
725  return *this;
726  }
727 
728  void Rotation(T deg, T a0, T a1, T a2)
729  {
730  T rad = (deg * (T)M_PI / (T)180.0) / (T)2.0;
731  (*this)[0] = std::cos(rad);
732  T s = std::sin(rad);
733  (*this)[1] = a0 * s;
734  (*this)[2] = a1 * s;
735  (*this)[3] = a2 * s;
736  (*this) /= SuperType::Length();
737  }
738 
739  void RotationRad(T rad, T a0, T a1, T a2)
740  {
741  (*this)[0] = std::cos(rad / 2);
742  T s = std::sin(rad / 2);
743  (*this)[1] = a0 * s;
744  (*this)[2] = a1 * s;
745  (*this)[3] = a2 * s;
746  (*this) /= SuperType::Length();
747  }
748 
749  void Rotation(T deg, const VectorXD< 3, T >& a)
750  {
751  T l = a.Length();
752  Rotation(deg, a[0] / l, a[1] / l, a[2] / l);
753  }
754 
755  void Rotation(T* deg, T* a0, T* a1, T* a2) const
756  {
757  *deg = ((T)std::acos((*this)[0]) * (T)2.0) * (T)180.0 / (T)M_PI;
758  T sinA = (T)std::sqrt(1.0 - (*this)[0] * (*this)[0]);
759  T absSin = sinA < 0 ? -sinA : sinA;
760  if (absSin < (T)0.00005)
761  {
762  sinA = (T)1.0;
763  }
764  *a0 = (*this)[1] / sinA;
765  *a1 = (*this)[2] / sinA;
766  *a2 = (*this)[3] / sinA;
767  }
768 
769  void RotationRad(T* rad, T* a0, T* a1, T* a2) const
770  {
771  *rad = ((T)std::acos((*this)[0]) * (T)2.0);
772  T sinA = (T)std::sqrt(1.0 - (*this)[0] * (*this)[0]);
773  T absSin = sinA < 0 ? -sinA : sinA;
774  if (absSin < (T)0.00005)
775  {
776  sinA = (T)1.0;
777  }
778  *a0 = (*this)[1] / sinA;
779  *a1 = (*this)[2] / sinA;
780  *a2 = (*this)[3] / sinA;
781  }
782 
783  void Rotation(T* deg, VectorXD< 3, T >* axis) const
784  {
785  Rotation(deg, &(*axis)[0], &(*axis)[1], &(*axis)[2]);
786  }
787 
788  template< class V >
789  void Rotate(const V& p, V* r) const
790  {
791  Quaternion< T > pp(0, p[0], p[1], p[2]);
792  Quaternion< T > rr = (*this) * pp * Conjugate();
793  (*r)[0] = rr[1];
794  (*r)[1] = rr[2];
795  (*r)[2] = rr[3];
796  }
797 
799  {
800  return Quaternion< T >((*this)[0], -(*this)[1], -(*this)[2],
801  -(*this)[3]);
802  }
803 
805  {
807  T s = 1 / (c.Length() * SuperType::Length());
808  for (unsigned int i = 0; i < 4; ++i)
809  {
810  c[i] *= s;
811  }
812  return c;
813  }
814 
815  template< class M >
816  void RotationMatrix(M* mat)
817  {
818  Quaternion< T >& q = *this;
819  T ww = q[0] * q[0];
820  T xx = q[1] * q[1];
821  T yy = q[2] * q[2];
822  T zz = q[3] * q[3];
823  T xy = q[1] * q[2] * 2;
824  T zw = q[0] * q[3] * 2;
825  T xz = q[1] * q[3] * 2;
826  T xw = q[1] * q[0] * 2;
827  T yw = q[0] * q[2] * 2;
828  T yz = q[2] * q[3] * 2;
829 
830  (*mat)[0][0] = ww + xx - yy - zz;
831  (*mat)[0][1] = xy + zw;
832  (*mat)[0][2] = xz - yw;
833 
834  (*mat)[1][0] = xy - zw;
835  (*mat)[1][1] = ww - xx + yy - zz;
836  (*mat)[1][2] = yz + xw;
837 
838  (*mat)[2][0] = xz + yw;
839  (*mat)[2][1] = yz - xw;
840  (*mat)[2][2] = ww - xx - yy + zz;
841 
842  /*(*mat)[0][0] = (T)1.0 - y2 - z2;
843  (*mat)[0][1] = xy - wz;
844  (*mat)[0][2] = xz + wy;
845 
846  (*mat)[1][0] = xy + wz;
847  (*mat)[1][1] = (T)1.0 - x2 - z2;
848  (*mat)[1][2] = yz - wx;
849 
850  (*mat)[2][0] = xz - wy;
851  (*mat)[2][1] = yz + wx;
852  (*mat)[2][2] = (T)1.0 - x2 - y2;*/
853  }
854  };
855 
856  template< class T >
858  const Quaternion< T >& b)
859  {
860  return Quaternion< T >(
861  a[0] * b[0] - a[1] * b[1] - a[2] * b[2] - a[3] * b[3],
862  a[0] * b[1] + a[1] * b[0] + a[2] * b[3] - a[3] * b[2],
863  a[0] * b[2] - a[1] * b[3] + a[2] * b[0] + a[3] * b[1],
864  a[0] * b[3] + a[1] * b[2] - a[2] * b[1] + a[3] * b[0]
865  );
866  }
867 };
868 #endif
GfxTL::Quaternion::Rotation
void Rotation(T *deg, VectorXD< 3, T > *axis) const
Definition: VectorXD.h:783
GfxTL::sqrt
VectorXD< D, T > sqrt(const VectorXD< D, T > &a)
Definition: VectorXD.h:662
GfxTL::VectorXD::operator=
ThisType & operator=(const SuperType &s)
Definition: VectorXD.h:164
GfxTL::Quaternion::Rotation
void Rotation(T *deg, T *a0, T *a1, T *a2) const
Definition: VectorXD.h:755
GfxTL::VectorXD::VectorXD
VectorXD()
Definition: VectorXD.h:34
GfxTL::VectorXD
Definition: MatrixXX.h:21
GfxTL::NullClass
Definition: NullClass.h:6
GfxTL::VectorXD::VectorXD
VectorXD(const S *v)
Definition: VectorXD.h:46
GfxTL::Quaternion::RotationRad
void RotationRad(T *rad, T *a0, T *a1, T *a2) const
Definition: VectorXD.h:769
GfxTL::VectorXD::VectorXD
VectorXD(T x, T y, T z)
Definition: VectorXD.h:137
GfxTL::Quaternion::Rotate
void Rotate(const V &p, V *r) const
Definition: VectorXD.h:789
GfxTL::Quaternion::Quaternion
Quaternion()
Definition: VectorXD.h:714
GfxTL::Vector3Dd
VectorXD< 3, double > Vector3Dd
Definition: VectorXD.h:677
GfxTL::vec2
VectorXD< 2, float > vec2
Definition: VectorXD.h:682
GfxTL::Quaternion::Inverse
Quaternion< T > Inverse() const
Definition: VectorXD.h:804
GfxTL::Vec1d
VectorXD< 1, double > Vec1d
Definition: VectorXD.h:693
GfxTL::ivec1
VectorXD< 1, int > ivec1
Definition: VectorXD.h:697
GfxTL::max
MatrixXX< C, R, T > max(const MatrixXX< C, R, T > &a, const MatrixXX< C, R, T > &b)
Definition: MatrixXX.h:581
GfxTL::OuterProduct
MatrixXX< B, A, T > OuterProduct(const VectorXD< A, T > &a, const VectorXD< B, T > &b)
Definition: VectorXD.h:466
GfxTL::Quaternion::Conjugate
Quaternion< T > Conjugate() const
Definition: VectorXD.h:798
GfxTL::vec3
VectorXD< 3, float > vec3
Definition: VectorXD.h:683
GfxTL::VectorXD::SuperType
MatrixXX< 1, D, T > SuperType
Definition: VectorXD.h:27
GfxTL::operator/
VectorXD< D, T > operator/(const VectorXD< D, T > &a, T s)
Definition: VectorXD.h:594
GfxTL::VectorXD::SqrLength
ScalarType SqrLength() const
Definition: VectorXD.h:248
GfxTL::VectorXD::end
const ScalarType * end() const
Definition: VectorXD.h:347
GfxTL::uvec3
VectorXD< 3, unsigned int > uvec3
Definition: VectorXD.h:703
GfxTL::VectorXD::VectorXD
VectorXD(const S x, typename std::enable_if< std::is_convertible< S, ScalarType >::value, NullClass >::type &dummy= *((NullClass *) 0))
Definition: VectorXD.h:76
GfxTL::Vec2d
VectorXD< 2, double > Vec2d
Definition: VectorXD.h:694
GfxTL::VectorXD::iterator
ScalarType * iterator
Definition: VectorXD.h:332
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
GfxTL::min
MatrixXX< C, R, T > min(const MatrixXX< C, R, T > &a, const MatrixXX< C, R, T > &b)
Definition: MatrixXX.h:568
GfxTL::Quaternion
Definition: VectorXD.h:707
GfxTL::VectorXD::operator[]
ScalarType operator[](unsigned int i) const
Definition: VectorXD.h:185
GfxTL::VectorXD::Distance
ScalarType Distance(const VectorXD< D, T > &v) const
Definition: VectorXD.h:291
GfxTL::Math::Abs
static ScalarT Abs(ScalarT s)
Definition: MathHelper.h:14
GfxTL::MatrixXX
Definition: MatrixXX.h:25
GfxTL::VectorXD::VectorXD
VectorXD(const VectorXD< D - 2, T > &v, T s, T s2)
Definition: VectorXD.h:107
GfxTL::VectorXD::operator*=
VectorXD< D, T > & operator*=(S s)
Definition: VectorXD.h:219
GfxTL::vec1
VectorXD< 1, float > vec1
Definition: VectorXD.h:681
GfxTL::VectorXD::const_iterator
const typedef ScalarType * const_iterator
Definition: VectorXD.h:333
GfxTL::VectorXD::L1Distance
ScalarType L1Distance(const VectorXD< D, T > &v) const
Definition: VectorXD.h:296
GfxTL::Quaternion::operator*=
Quaternion< T > & operator*=(const Quaternion< T > &b)
Definition: VectorXD.h:721
GfxTL::Quaternion::SuperType
VectorXD< 4, T > SuperType
Definition: VectorXD.h:712
GfxTL::Vector3Df
VectorXD< 3, float > Vector3Df
Definition: VectorXD.h:676
GfxTL::VectorXD::Zero
void Zero()
Definition: VectorXD.h:268
GfxTL::vec2f
VectorXD< 2, float > vec2f
Definition: VectorXD.h:686
GfxTL::Quaternion::Rotation
void Rotation(T deg, T a0, T a1, T a2)
Definition: VectorXD.h:728
GfxTL::ivec2
VectorXD< 2, int > ivec2
Definition: VectorXD.h:698
armarx::ctrlutil::a
double a(double t, double a0, double j)
Definition: CtrlUtil.h:45
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:926
GfxTL::uvec1
VectorXD< 1, unsigned int > uvec1
Definition: VectorXD.h:701
GfxTL::operator<<
std::ostream & operator<<(std::ostream &o, const Array< DimT, IteratorT > &a)
Definition: Array.h:166
GfxTL::Vector4Df
VectorXD< 4, float > Vector4Df
Definition: VectorXD.h:678
armarx::abs
std::vector< T > abs(const std::vector< T > &v)
Definition: VectorHelpers.h:253
M_PI
#define M_PI
Definition: MathTools.h:17
GfxTL::VectorXD::MaxDistance
ScalarType MaxDistance(const VectorXD< D, T > &v) const
Definition: VectorXD.h:306
GfxTL::uvec4
VectorXD< 4, unsigned int > uvec4
Definition: VectorXD.h:704
GfxTL::Vector1Df
VectorXD< 1, float > Vector1Df
Definition: VectorXD.h:672
GfxTL::ivec4
VectorXD< 4, int > ivec4
Definition: VectorXD.h:700
GfxTL::MatrixXX::operator=
ThisType & operator=(T v)
Definition: MatrixXX.h:173
GfxTL::VectorXD::begin
const ScalarType * begin() const
Definition: VectorXD.h:343
GfxTL::Vec3d
VectorXD< 3, double > Vec3d
Definition: VectorXD.h:695
GfxTL::Quaternion::ScalarType
T ScalarType
Definition: VectorXD.h:711
GfxTL::VectorXD::value_type
T value_type
Definition: VectorXD.h:25
GfxTL::VectorXD::VectorXD
VectorXD(T x, T y)
Definition: VectorXD.h:128
GfxTL::VectorXD::VectorXD
VectorXD(T x)
Definition: VectorXD.h:67
GfxTL::VectorXD::Dim
@ Dim
Definition: VectorXD.h:31
GfxTL::VectorXD::operator/=
VectorXD< D, T > & operator/=(S s)
Definition: VectorXD.h:229
GfxTL::Vec4d
VectorXD< 4, double > Vec4d
Definition: VectorXD.h:696
GfxTL::VectorXD::VectorXD
VectorXD(const SuperType &s)
Definition: VectorXD.h:63
GfxTL::Quaternion::Quaternion
Quaternion(T w, T x, T y, T z)
Definition: VectorXD.h:717
GfxTL::Quaternion::Rotation
void Rotation(T deg, const VectorXD< 3, T > &a)
Definition: VectorXD.h:749
GfxTL::VectorXD::VectorXD
VectorXD(const T *v)
Definition: VectorXD.h:40
GfxTL::operator*
const MatrixXX< C, R, T > operator*(T s, const MatrixXX< C, R, T > &a)
Definition: MatrixXX.h:379
GfxTL::VectorXD::VectorXD
VectorXD(const VectorXD< D, S > &v)
Definition: VectorXD.h:55
GfxTL::Vec1f
VectorXD< 1, float > Vec1f
Definition: VectorXD.h:689
GfxTL::VectorXD::VectorXD
VectorXD(const VectorXD< D, T > &v)
Definition: VectorXD.h:36
GfxTL::VectorXD::ScalarType
T ScalarType
Definition: VectorXD.h:24
q
#define q
GfxTL
Definition: AABox.h:8
GfxTL::vec1f
VectorXD< 1, float > vec1f
Definition: VectorXD.h:685
GfxTL::VectorXD::begin
ScalarType * begin()
Definition: VectorXD.h:335
GfxTL::VectorXD::operator=
ThisType & operator=(const ThisType &v)
Definition: VectorXD.h:158
GfxTL::operator%
const VectorXD< 3, T > operator%(const VectorXD< 3, T > &a, const VectorXD< 3, T > &b)
Definition: VectorXD.h:630
GfxTL::VectorXD::operator-
VectorXD< D, T > operator-() const
Definition: VectorXD.h:238
A
class A(deque< T, A >)) ARMARX_OVERLOAD_STD_HASH_FOR_ITERABLE((class T
Enables hashing of std::list.
GfxTL::VectorXD::VectorXD
VectorXD(const VectorXD< D - 1, T > &v, T s)
Definition: VectorXD.h:98
GfxTL::VectorXD::VectorXD
VectorXD(const VectorXD< X, T > &vec)
Definition: VectorXD.h:86
MatrixXX.h
GfxTL::vec3f
VectorXD< 3, float > vec3f
Definition: VectorXD.h:687
armarx::ctrlutil::v
double v(double t, double v0, double a0, double j)
Definition: CtrlUtil.h:39
GfxTL::Vector2Df
VectorXD< 2, float > Vector2Df
Definition: VectorXD.h:674
GfxTL::Quaternion::RotationRad
void RotationRad(T rad, T a0, T a1, T a2)
Definition: VectorXD.h:739
std
Definition: Application.h:66
GfxTL::MatrixXX::AssertDim::AssertEqual
static void AssertEqual()
Definition: MatrixXX.h:211
NullClass.h
GfxTL::VectorXD::operator=
ThisType & operator=(const MatrixXX< 1, D, S > &v)
Definition: VectorXD.h:171
GfxTL::Vec4f
VectorXD< 4, float > Vec4f
Definition: VectorXD.h:692
GfxTL::Vector1Dd
VectorXD< 1, double > Vector1Dd
Definition: VectorXD.h:673
GfxTL::operator+
const MatrixXX< C, R, T > operator+(const MatrixXX< C, R, T > &a, const MatrixXX< C, R, T > &b)
Definition: MatrixXX.h:414
GfxTL::Quaternion::RotationMatrix
void RotationMatrix(M *mat)
Definition: VectorXD.h:816
GfxTL::VectorXD::operator==
bool operator==(const VectorXD< D, T > &a) const
Definition: VectorXD.h:273
GfxTL::VectorXD::L1Length
ScalarType L1Length() const
Definition: VectorXD.h:258
GfxTL::Vec3f
VectorXD< 3, float > Vec3f
Definition: VectorXD.h:691
GfxTL::VectorXD::operator+=
VectorXD< D, T > & operator+=(const MatrixXX< 1, D, T > &a)
Definition: VectorXD.h:200
GfxTL::VectorXD::ThisType
VectorXD< D, T > ThisType
Definition: VectorXD.h:26
GfxTL::vec4
VectorXD< 4, float > vec4
Definition: VectorXD.h:684
GfxTL::ivec3
VectorXD< 3, int > ivec3
Definition: VectorXD.h:699
T
float T
Definition: UnscentedKalmanFilterTest.cpp:35
StdOverrides.h
min
T min(T t1, T t2)
Definition: gdiam.h:42
GfxTL::VectorXD::operator[]
ScalarType & operator[](unsigned int i)
Definition: VectorXD.h:180
MathHelper.h
GfxTL::uvec2
VectorXD< 2, unsigned int > uvec2
Definition: VectorXD.h:702
GfxTL::Vector2Dd
VectorXD< 2, double > Vector2Dd
Definition: VectorXD.h:675
GfxTL::operator-
MatrixXX< C, R, T > operator-(const MatrixXX< C, R, T > &a)
Definition: MatrixXX.h:340
GfxTL::VectorXD::Homogene
VectorXD< Dim+1, T > Homogene() const
Definition: VectorXD.h:321
armarx::ctrlutil::s
double s(double t, double s0, double v0, double a0, double j)
Definition: CtrlUtil.h:33
GfxTL::VectorXD::VectorXD
VectorXD(const VectorXD< D - 3, T > &v, T s, T s2, T s3)
Definition: VectorXD.h:117
memory.h
GfxTL::VectorXD::SqrDistance
ScalarType SqrDistance(const VectorXD< D, T > &v) const
Definition: VectorXD.h:278
GfxTL::Vec2f
VectorXD< 2, float > Vec2f
Definition: VectorXD.h:690
GfxTL::VectorXD::VectorXD
VectorXD(T x, T y, T z, T w)
Definition: VectorXD.h:147
GfxTL::Vector4Dd
VectorXD< 4, double > Vector4Dd
Definition: VectorXD.h:679
GfxTL::VectorXD::end
ScalarType * end()
Definition: VectorXD.h:339
GfxTL::VectorXD::operator-=
VectorXD< D, T > & operator-=(const MatrixXX< 1, D, T > &a)
Definition: VectorXD.h:209
GfxTL::SqrOuterProduct
MatrixXX< D, D, T > SqrOuterProduct(const VectorXD< D, T > &a)
Definition: VectorXD.h:478
GfxTL::VectorXD::Length
ScalarType Length() const
Definition: VectorXD.h:243
GfxTL::vec4f
VectorXD< 4, float > vec4f
Definition: VectorXD.h:688