37 #ifndef VIGRA_TINYVECTOR_HXX
38 #define VIGRA_TINYVECTOR_HXX
52 #include "metaprogramming.hxx"
53 #include "numerictraits.hxx"
55 #include "mathutil.hxx"
58 #ifdef VIGRA_CHECK_BOUNDS
59 #define VIGRA_ASSERT_INSIDE(diff) \
60 vigra_precondition(diff >= 0, "Index out of bounds");\
61 vigra_precondition(diff < SIZE, "Index out of bounds");
63 #define VIGRA_ASSERT_INSIDE(diff)
70 #pragma warning( push )
71 #pragma warning( disable : 4503 )
80 template <
class V1,
int SIZE,
class D1,
class D2>
83 template <
class V1,
int SIZE,
class D1,
class D2>
91 #define VIGRA_EXEC_LOOP(NAME, OPER) \
92 template <class T1, class T2> \
93 static void NAME(T1 * left, T2 const * right) \
95 for(int i=0; i<LEVEL; ++i) \
96 (left[i]) OPER (right[i]); \
99 #define VIGRA_EXEC_LOOP_MINMAX(NAME, OPER) \
100 template <class T1, class T2> \
101 static void NAME(T1 * left, T2 const * right) \
103 for(int i=0; i<LEVEL; ++i) \
104 if(left[i] OPER right[i]) \
105 left[i] = right[i]; \
108 #define VIGRA_EXEC_LOOP_SCALAR(NAME, OPER) \
109 template <class T1, class T2> \
110 static void NAME(T1 * left, T2 right) \
112 for(int i=0; i<LEVEL; ++i) \
113 (left[i]) = detail::RequiresExplicitCast<T1>::cast((left[i]) OPER (right)); \
119 template <
class T1,
class T2>
120 static void assignCast(T1 * left, T2
const * right)
122 for(
int i=0; i<LEVEL; ++i)
123 left[i] = detail::RequiresExplicitCast<T1>::cast(right[i]);
126 template <
class T1,
class T2>
127 static void reverseAssign(T1 * left, T2
const * right)
129 for(
int i=0; i<LEVEL; ++i)
133 template <
class T1,
class T2>
134 static void assignScalar(T1 * left, T2 right)
136 for(
int i=0; i<LEVEL; ++i)
137 left[i] = detail::RequiresExplicitCast<T1>::cast(right);
140 template <
class T1,
class T2>
141 static void power(T1 * left, T2 right)
143 for(
int i=0; i<LEVEL; ++i)
144 left[i] = detail::RequiresExplicitCast<T1>::cast(pow(left, right));
147 VIGRA_EXEC_LOOP(assign, =)
148 VIGRA_EXEC_LOOP(
add, +=)
149 VIGRA_EXEC_LOOP(
sub, -=)
150 VIGRA_EXEC_LOOP(
mul, *=)
151 VIGRA_EXEC_LOOP(
div, /=)
152 VIGRA_EXEC_LOOP(mod, %=)
153 VIGRA_EXEC_LOOP(neg, = -)
154 VIGRA_EXEC_LOOP(
abs, = vigra::abs)
155 VIGRA_EXEC_LOOP(
floor, = vigra::floor)
156 VIGRA_EXEC_LOOP(
ceil, = vigra::ceil)
157 VIGRA_EXEC_LOOP(
round, = vigra::round)
158 VIGRA_EXEC_LOOP(
sqrt, = vigra::sqrt)
159 VIGRA_EXEC_LOOP(fromPromote, = NumericTraits<T1>::fromPromote)
160 VIGRA_EXEC_LOOP(fromRealPromote, = NumericTraits<T1>::fromRealPromote)
161 VIGRA_EXEC_LOOP_SCALAR(mulScalar, *)
162 VIGRA_EXEC_LOOP_SCALAR(divScalar, /)
164 VIGRA_EXEC_LOOP_MINMAX(min, >)
165 VIGRA_EXEC_LOOP_MINMAX(max, <)
168 static T const & minimum(T const * p)
170 return *std::min_element(p, p+LEVEL);
174 static T
const & maximum(T
const * p)
176 return *std::max_element(p, p+LEVEL);
180 static bool all(T
const * p, T
const & zero)
182 for(
int i=0; i<LEVEL; ++i)
189 static bool any(T
const * p, T
const & zero)
191 for(
int i=0; i<LEVEL; ++i)
197 template <
class T1,
class T2>
198 static bool notEqual(T1
const * left, T2
const * right)
200 for(
int i=0; i<LEVEL; ++i)
201 if(left[i] != right[i])
206 template <
class T1,
class T2>
207 static bool less(T1
const * left, T2
const * right)
209 for(
int i=0; i<LEVEL; ++i)
211 if(left[i] < right[i])
213 if(right[i] < left[i])
223 for(
int i=0; i<LEVEL; ++i)
231 static typename NumericTraits<T>::Promote
234 typename NumericTraits<T>::Promote res(*d * *d);
235 for(
int i=1; i<LEVEL; ++i)
240 template <
class T1,
class T2>
241 static typename PromoteTraits<T1, T2>::Promote
242 dot(T1
const * left, T2
const * right)
244 typename PromoteTraits<T1, T2>::Promote res(*left * *right);
245 for(
int i=1; i<LEVEL; ++i)
246 res += left[i] * right[i];
251 static typename NormTraits<T>::SquaredNormType
255 for(
int i=1; i<LEVEL; ++i)
262 struct UnrollScalarResult
265 static typename NumericTraits<T>::Promote
271 template <
class T1,
class T2>
272 static typename PromoteTraits<T1, T2>::Promote
273 dot(T1
const * left, T2
const * right)
279 static typename NormTraits<T>::SquaredNormType
285 static std::ptrdiff_t
292 static T
const & minimum(T
const * p)
294 T
const & m = UnrollScalarResult<LEVEL - 1>::minimum(p+1);
301 static T
const & maximum(T
const * p)
303 T
const & m = UnrollScalarResult<LEVEL - 1>::maximum(p+1);
310 static bool all(T
const * p, T
const & zero)
312 return *p != zero && UnrollScalarResult<LEVEL - 1>::all(p+1, zero);
316 static bool any(T
const * p, T
const & zero)
318 return *p != zero || UnrollScalarResult<LEVEL - 1>::any(p+1, zero);
323 struct UnrollScalarResult<1>
326 static typename NumericTraits<T>::Promote
332 template <
class T1,
class T2>
333 static typename PromoteTraits<T1, T2>::Promote
334 dot(T1
const * left, T2
const * right)
336 return *left * *right;
340 static typename NormTraits<T>::SquaredNormType
346 static std::ptrdiff_t
353 static T
const & minimum(T
const * p)
359 static T
const & maximum(T
const * p)
365 static bool all(T
const * p, T
const & zero)
371 static bool any(T
const * p, T
const & zero)
377 #undef VIGRA_EXEC_LOOP
378 #undef VIGRA_EXEC_LOOP_MINMAX
379 #undef VIGRA_EXEC_LOOP_SCALAR
381 #define VIGRA_UNROLL_LOOP(NAME, OPER) \
382 template <class T1, class T2> \
383 static void NAME(T1 * left, T2 const * right) \
385 (*left) OPER (*right); \
386 UnrollLoop<LEVEL-1>::NAME(left+1, right+1); \
389 #define VIGRA_UNROLL_LOOP_MINMAX(NAME, OPER) \
390 template <class T1, class T2> \
391 static void NAME(T1 * left, T2 const * right) \
393 if(*left OPER *right) \
395 UnrollLoop<LEVEL-1>::NAME(left+1, right+1); \
398 #define VIGRA_UNROLL_LOOP_SCALAR(NAME, OPER) \
399 template <class T1, class T2> \
400 static void NAME(T1 * left, T2 right) \
402 (*left) = detail::RequiresExplicitCast<T1>::cast((*left) OPER (right)); \
403 UnrollLoop<LEVEL-1>::NAME(left+1, right); \
410 template <
class T1,
class T2>
411 static void reverseAssign(T1 * left, T2
const * right)
414 UnrollLoop<LEVEL-1>::reverseAssign(left+1, right-1);
417 template <
class T1,
class T2>
418 static void assignCast(T1 * left, T2
const * right)
420 *left = detail::RequiresExplicitCast<T1>::cast(*right);
421 UnrollLoop<LEVEL-1>::assignCast(left+1, right+1);
424 template <
class T1,
class T2>
425 static void assignScalar(T1 * left, T2 right)
427 *left = detail::RequiresExplicitCast<T1>::cast(right);
428 UnrollLoop<LEVEL-1>::assignScalar(left+1, right);
431 template <
class T1,
class T2>
432 static void power(T1 * left, T2 right)
434 *left = detail::RequiresExplicitCast<T1>::cast(pow(*left, right));
438 VIGRA_UNROLL_LOOP(assign, =)
439 VIGRA_UNROLL_LOOP(
add, +=)
440 VIGRA_UNROLL_LOOP(
sub, -=)
441 VIGRA_UNROLL_LOOP(
mul, *=)
442 VIGRA_UNROLL_LOOP(
div, /=)
443 VIGRA_UNROLL_LOOP(mod, %=)
444 VIGRA_UNROLL_LOOP(neg, = -)
445 VIGRA_UNROLL_LOOP(
abs, = vigra::abs)
446 VIGRA_UNROLL_LOOP(
floor, = vigra::floor)
447 VIGRA_UNROLL_LOOP(
ceil, = vigra::ceil)
448 VIGRA_UNROLL_LOOP(
round, = vigra::round)
449 VIGRA_UNROLL_LOOP(
sqrt, = vigra::sqrt)
450 VIGRA_UNROLL_LOOP(fromPromote, = NumericTraits<T1>::fromPromote)
451 VIGRA_UNROLL_LOOP(fromRealPromote, = NumericTraits<T1>::fromRealPromote)
452 VIGRA_UNROLL_LOOP_SCALAR(mulScalar, *)
453 VIGRA_UNROLL_LOOP_SCALAR(divScalar, /)
455 VIGRA_UNROLL_LOOP_MINMAX(min, >)
456 VIGRA_UNROLL_LOOP_MINMAX(max, <)
459 static T const & minimum(T const * p)
461 return UnrollScalarResult<LEVEL>::minimum(p);
465 static T
const & maximum(T
const * p)
467 return UnrollScalarResult<LEVEL>::maximum(p);
471 static bool all(T
const * p, T
const & zero)
473 return UnrollScalarResult<LEVEL>::all(p, zero);
477 static bool any(T
const * p, T
const & zero)
479 return UnrollScalarResult<LEVEL>::any(p, zero);
482 template <
class T1,
class T2>
483 static bool notEqual(T1
const * left, T2
const * right)
485 return (*left != *right) || UnrollLoop<LEVEL - 1>::notEqual(left+1, right+1);
488 template <
class T1,
class T2>
489 static bool less(T1
const * left, T2
const * right)
495 return UnrollLoop<LEVEL - 1>::less(left+1, right+1);
506 static typename NumericTraits<T>::Promote
512 template <
class T1,
class T2>
513 static typename PromoteTraits<T1, T2>::Promote
514 dot(T1
const * left, T2
const * right)
520 static typename NormTraits<T>::SquaredNormType
527 #undef VIGRA_UNROLL_LOOP
528 #undef VIGRA_UNROLL_LOOP_MINMAX
529 #undef VIGRA_UNROLL_LOOP_SCALAR
534 template <
class T1,
class T2>
535 static void reverseAssign(T1, T2) {}
536 template <
class T1,
class T2>
537 static void assignCast(T1, T2) {}
538 template <
class T1,
class T2>
539 static void assign(T1, T2) {}
540 template <
class T1,
class T2>
541 static void assignScalar(T1, T2) {}
542 template <
class T1,
class T2>
543 static void power(T1, T2) {}
544 template <
class T1,
class T2>
545 static void add(T1, T2) {}
546 template <
class T1,
class T2>
547 static void sub(T1, T2) {}
548 template <
class T1,
class T2>
549 static void mul(T1, T2) {}
550 template <
class T1,
class T2>
551 static void mulScalar(T1, T2) {}
552 template <
class T1,
class T2>
553 static void div(T1, T2) {}
554 template <
class T1,
class T2>
555 static void mod(T1, T2) {}
556 template <
class T1,
class T2>
557 static void divScalar(T1, T2) {}
558 template <
class T1,
class T2>
559 static void fromPromote(T1, T2) {}
560 template <
class T1,
class T2>
561 static void fromRealPromote(T1, T2) {}
562 template <
class T1,
class T2>
563 static void neg(T1, T2) {}
564 template <
class T1,
class T2>
565 static void abs(T1, T2) {}
566 template <
class T1,
class T2>
567 static void floor(T1, T2) {}
568 template <
class T1,
class T2>
569 static void ceil(T1, T2) {}
570 template <
class T1,
class T2>
571 static void round(T1, T2) {}
572 template <
class T1,
class T2>
573 static void sqrt(T1, T2) {}
574 template <
class T1,
class T2>
575 static bool notEqual(T1, T2) {
return false; }
576 template <
class T1,
class T2>
577 static bool less(T1, T2) {
return false; }
578 template <
class T1,
class T2>
579 static void min(T1, T2) {}
580 template <
class T1,
class T2>
581 static void max(T1, T2) {}
583 static T minimum(T
const *) {
return NumericTraits<T>::max(); }
585 static T maximum(T
const *) {
return NumericTraits<T>::min(); }
587 static bool all(T
const *, T
const &) {
return true; }
589 static bool any(T
const *, T
const &) {
return false; }
597 static const int MaxUnrollSize = 5;
598 typedef typename IfBool<(SIZE <= MaxUnrollSize), UnrollLoop<SIZE>, ExecLoop<SIZE> >::type type;
604 inline DontInit dontInit() {
return DontInit(); }
608 template <
class T,
int SIZE>
611 template <
class T,
int SIZE>
629 template <
class VALUETYPE,
int SIZE,
class DATA,
class DERIVED>
638 typedef typename detail::LoopType<SIZE>::type Loop;
690 typedef typename SquareRootTraits<SquaredNormType>::SquareRootResult
NormType;
694 enum { static_size = SIZE };
698 template <
class Iterator>
701 vigra_precondition(end-i == SIZE,
702 "TinyVector::init(): Sequence has wrong size.");
703 Loop::assignCast(data_, i);
710 Loop::assignScalar(data_, initial);
715 template <
class T1,
class D1,
class D2>
719 return static_cast<DERIVED &
>(*this);
724 template <
class T1,
class D1,
class D2>
728 return static_cast<DERIVED &
>(*this);
733 template <
class T1,
class D1,
class D2>
737 return static_cast<DERIVED &
>(*this);
742 template <
class T1,
class D1,
class D2>
746 return static_cast<DERIVED &
>(*this);
751 template <
class T1,
class D1,
class D2>
754 Loop::mod(data_, r.
begin());
755 return static_cast<DERIVED &
>(*this);
762 Loop::mulScalar(data_, r);
763 return static_cast<DERIVED &
>(*this);
770 Loop::divScalar(data_, r);
771 return static_cast<DERIVED &
>(*this);
778 return sqrt(
static_cast<typename
779 SquareRootTraits<SquaredNormType>::SquareRootArgument
>(
squaredMagnitude()));
793 return Loop::minimum(data_);
800 return Loop::maximum(data_);
807 return Loop::all(data_, VALUETYPE());
814 return Loop::any(data_, VALUETYPE());
821 VIGRA_ASSERT_INSIDE(i);
829 VIGRA_ASSERT_INSIDE(i);
852 template <
int FROM,
int TO>
855 #ifdef VIGRA_CHECK_BOUNDS
856 vigra_precondition(FROM >= 0,
"Index out of bounds");
857 vigra_precondition(FROM < TO,
"Index out of bounds");
858 vigra_precondition(TO <=SIZE,
"Index out of bounds");
867 pointer data() {
return data_; }
871 static TinyVector<VALUETYPE, SIZE> unitVector(
int k)
873 VIGRA_ASSERT_INSIDE(k);
874 TinyVector<VALUETYPE, SIZE> ret;
912 template <
class T,
int SIZE>
914 :
public TinyVectorBase<T, SIZE, T[SIZE], TinyVector<T, SIZE> >
916 typedef TinyVectorBase<T, SIZE, T[SIZE], TinyVector<T, SIZE> > BaseType;
917 typedef typename BaseType::Loop Loop;
934 enum ReverseCopyTag { ReverseCopy };
963 BaseType::data_[0] = detail::RequiresExplicitCast<T>::cast(initial.
x);
964 BaseType::data_[1] = detail::RequiresExplicitCast<T>::cast(initial.
y);
973 BaseType::data_[0] = i1;
974 BaseType::data_[1] = i2;
980 TinyVector(value_type
const & i1, value_type
const & i2, value_type
const & i3)
983 BaseType::data_[0] = i1;
984 BaseType::data_[1] = i2;
985 BaseType::data_[2] = i3;
992 value_type
const & i3, value_type
const & i4)
995 BaseType::data_[0] = i1;
996 BaseType::data_[1] = i2;
997 BaseType::data_[2] = i3;
998 BaseType::data_[3] = i4;
1005 value_type
const & i3, value_type
const & i4,
1006 value_type
const & i5)
1009 BaseType::data_[0] = i1;
1010 BaseType::data_[1] = i2;
1011 BaseType::data_[2] = i3;
1012 BaseType::data_[3] = i4;
1013 BaseType::data_[4] = i5;
1021 Loop::assignScalar(BaseType::data_, value_type());
1039 Loop::assign(BaseType::data_, r.data_);
1048 Loop::assign(BaseType::data_, data);
1062 Loop::reverseAssign(BaseType::data_, data+SIZE-1);
1067 template <
class U,
class DATA,
class DERIVED>
1071 Loop::assignCast(BaseType::data_, r.
begin());
1078 Loop::assign(BaseType::data_, r.data_);
1084 template <
class U,
class DATA,
class DERIVED>
1087 Loop::assignCast(BaseType::data_, r.
begin());
1097 BaseType::data_[0] = detail::RequiresExplicitCast<T>::cast(r.
x);
1098 BaseType::data_[1] = detail::RequiresExplicitCast<T>::cast(r.
y);
1114 template <
class U,
int USIZE,
class DATA,
class DERIVED>
1117 static const int minSize = USIZE < SIZE
1121 typedef typename detail::LoopType<minSize>::type MinLoop;
1122 MinLoop::assignCast(BaseType::data_, r.
begin());
1156 template <
class T,
int SIZE>
1157 class TinyVectorView
1158 :
public TinyVectorBase<T, SIZE, T *, TinyVectorView<T, SIZE> >
1160 typedef TinyVectorBase<T, SIZE, T *, TinyVectorView<T, SIZE> > BaseType;
1161 typedef typename BaseType::Loop Loop;
1184 BaseType::data_ = 0;
1192 BaseType::data_ =
const_cast<pointer
>(data);
1200 BaseType::data_ =
const_cast<pointer
>(other.data_);
1205 template <
class DATA,
class DERIVED>
1209 BaseType::data_ =
const_cast<pointer
>(other.data());
1216 Loop::assign(BaseType::data_, r.begin());
1222 template <
class U,
class DATA,
class DERIVED>
1225 Loop::assignCast(BaseType::data_, r.
begin());
1248 template <
class V1,
int SIZE,
class D1,
class D2,
class V2,
class D3,
class D4>
1257 template <
class V1,
int SIZE,
class D1,
class D2,
class V2,
class D3,
class D4>
1262 typedef typename detail::LoopType<SIZE>::type ltype;
1263 return ltype::notEqual(l.
begin(), r.
begin());
1267 template <
class V1,
int SIZE,
class D1,
class D2,
class V2,
class D3,
class D4>
1269 operator<(TinyVectorBase<V1, SIZE, D1, D2>
const & l,
1272 typedef typename detail::LoopType<SIZE>::type ltype;
1273 return ltype::less(l.begin(), r.begin());
1276 template <
class V,
int SIZE,
class D1,
class D2,
class D3,
class D4>
1279 TinyVectorBase<V, SIZE, D3, D4>
const & r,
1280 V epsilon = NumericTraits<V>::epsilon())
1282 typedef typename detail::LoopType<SIZE>::type ltype;
1286 template <
class V,
int SIZE>
1289 TinyVector<V, SIZE>
const & r,
1290 V epsilon = NumericTraits<V>::epsilon())
1292 typedef typename detail::LoopType<SIZE>::type ltype;
1303 template <
class V1,
int SIZE,
class DATA,
class DERIVED>
1305 operator<<(std::ostream & out, TinyVectorBase<V1, SIZE, DATA, DERIVED>
const & l)
1309 for(i=0; i<SIZE-1; ++i)
1310 out << l[i] <<
", ";
1368 #if !defined(NO_PARTIAL_TEMPLATE_SPECIALIZATION)
1370 template <
class T,
int SIZE>
1371 struct NumericTraits<TinyVector<T, SIZE> >
1373 typedef TinyVector<T, SIZE> Type;
1374 typedef TinyVector<typename NumericTraits<T>::Promote, SIZE> Promote;
1375 typedef TinyVector<typename NumericTraits<T>::RealPromote, SIZE> RealPromote;
1376 typedef TinyVector<typename NumericTraits<T>::ComplexPromote, SIZE> ComplexPromote;
1377 typedef T ValueType;
1379 typedef typename NumericTraits<T>::isIntegral isIntegral;
1380 typedef VigraFalseType isScalar;
1381 typedef typename NumericTraits<T>::isSigned isSigned;
1382 typedef VigraTrueType isOrdered;
1383 typedef VigraFalseType isComplex;
1385 static TinyVector<T, SIZE> zero()
1387 return TinyVector<T, SIZE>(NumericTraits<T>::zero());
1389 static TinyVector<T, SIZE> one()
1391 return TinyVector<T, SIZE>(NumericTraits<T>::one());
1393 static TinyVector<T, SIZE> nonZero()
1395 return TinyVector<T, SIZE>(NumericTraits<T>::nonZero());
1398 static TinyVector<T, SIZE> min()
1400 return TinyVector<T, SIZE>(NumericTraits<T>::min());
1402 static TinyVector<T, SIZE> max()
1404 return TinyVector<T, SIZE>(NumericTraits<T>::max());
1407 template <
class D1,
class D2>
1408 static Promote toPromote(TinyVectorBase<T, SIZE, D1, D2>
const & v)
1413 template <
class D1,
class D2>
1414 static RealPromote toRealPromote(TinyVectorBase<T, SIZE, D1, D2>
const & v)
1416 return RealPromote(v);
1419 template <
class D1,
class D2>
1420 static TinyVector<T, SIZE>
1421 fromPromote(TinyVectorBase<
typename NumericTraits<T>::Promote, SIZE, D1, D2>
const & v)
1423 TinyVector<T, SIZE> res(detail::dontInit());
1424 typedef typename detail::LoopType<SIZE>::type ltype;
1425 ltype::fromPromote(res.begin(), v.begin());
1429 template <
class D1,
class D2>
1430 static TinyVector<T, SIZE>
1431 fromRealPromote(TinyVectorBase<
typename NumericTraits<T>::RealPromote, SIZE, D1, D2>
const & v)
1433 TinyVector<T, SIZE> res(detail::dontInit());
1434 typedef typename detail::LoopType<SIZE>::type ltype;
1435 ltype::fromRealPromote(res.begin(), v.begin());
1440 template <
class T,
int SIZE>
1441 struct NumericTraits<TinyVectorView<T, SIZE> >
1442 :
public NumericTraits<TinyVector<T, SIZE> >
1444 typedef TinyVector<T, SIZE> Type;
1445 typedef TinyVector<typename NumericTraits<T>::Promote, SIZE> Promote;
1446 typedef TinyVector<typename NumericTraits<T>::RealPromote, SIZE> RealPromote;
1447 typedef TinyVector<typename NumericTraits<T>::ComplexPromote, SIZE> ComplexPromote;
1448 typedef T ValueType;
1450 typedef typename NumericTraits<T>::isIntegral isIntegral;
1451 typedef VigraFalseType isScalar;
1452 typedef typename NumericTraits<T>::isSigned isSigned;
1453 typedef VigraFalseType isOrdered;
1454 typedef VigraFalseType isComplex;
1457 template <
class T,
int SIZE>
1458 struct NormTraits<TinyVector<T, SIZE> >
1460 typedef TinyVector<T, SIZE> Type;
1461 typedef typename Type::SquaredNormType SquaredNormType;
1462 typedef typename Type::NormType NormType;
1465 template <
class T,
int SIZE>
1466 struct NormTraits<TinyVectorView<T, SIZE> >
1468 typedef TinyVector<T, SIZE> Type;
1469 typedef typename Type::SquaredNormType SquaredNormType;
1470 typedef typename Type::NormType NormType;
1473 template <
class T1,
class T2,
int SIZE>
1474 struct PromoteTraits<TinyVector<T1, SIZE>, TinyVector<T2, SIZE> >
1476 typedef TinyVector<typename PromoteTraits<T1, T2>::Promote, SIZE> Promote;
1479 template <
class T1,
class T2,
int SIZE>
1480 struct PromoteTraits<TinyVectorView<T1, SIZE>, TinyVectorView<T2, SIZE> >
1482 typedef TinyVector<typename PromoteTraits<T1, T2>::Promote, SIZE> Promote;
1485 template <
class T1,
class T2,
int SIZE>
1486 struct PromoteTraits<TinyVectorView<T1, SIZE>, TinyVector<T2, SIZE> >
1488 typedef TinyVector<typename PromoteTraits<T1, T2>::Promote, SIZE> Promote;
1491 template <
class T1,
class T2,
int SIZE>
1492 struct PromoteTraits<TinyVector<T1, SIZE>, TinyVectorView<T2, SIZE> >
1494 typedef TinyVector<typename PromoteTraits<T1, T2>::Promote, SIZE> Promote;
1497 template <
class T,
int SIZE>
1498 struct PromoteTraits<TinyVector<T, SIZE>, double >
1500 typedef TinyVector<typename NumericTraits<T>::RealPromote, SIZE> Promote;
1503 template <
class T,
int SIZE>
1504 struct PromoteTraits<double, TinyVector<T, SIZE> >
1506 typedef TinyVector<typename NumericTraits<T>::RealPromote, SIZE> Promote;
1509 template <
class T,
int SIZE>
1510 struct PromoteTraits<TinyVectorView<T, SIZE>, double >
1512 typedef TinyVector<typename NumericTraits<T>::RealPromote, SIZE> Promote;
1515 template <
class T,
int SIZE>
1516 struct PromoteTraits<double, TinyVectorView<T, SIZE> >
1518 typedef TinyVector<typename NumericTraits<T>::RealPromote, SIZE> Promote;
1521 template<
class T,
int SIZE>
1522 struct CanSkipInitialization<TinyVectorView<T, SIZE> >
1524 typedef typename CanSkipInitialization<T>::type type;
1525 static const bool value = type::asBool;
1528 template<
class T,
int SIZE>
1529 struct CanSkipInitialization<TinyVector<T, SIZE> >
1531 typedef typename CanSkipInitialization<T>::type type;
1532 static const bool value = type::asBool;
1537 #else // NO_PARTIAL_TEMPLATE_SPECIALIZATION
1540 #define TINYVECTOR_NUMTRAITS(T, SIZE) \
1542 struct NumericTraits<TinyVector<T, SIZE> >\
1544 typedef TinyVector<T, SIZE> Type;\
1545 typedef TinyVector<NumericTraits<T>::Promote, SIZE> Promote;\
1546 typedef TinyVector<NumericTraits<T>::RealPromote, SIZE> RealPromote;\
1547 typedef TinyVector<NumericTraits<T>::ComplexPromote, SIZE> ComplexPromote;\
1548 typedef T ValueType; \
1549 typedef NumericTraits<T>::isIntegral isIntegral;\
1550 typedef VigraFalseType isScalar;\
1551 typedef NumericTraits<T>::isSigned isSigned; \
1552 typedef VigraFalseType isOrdered;\
1553 typedef VigraFalseType isComplex;\
1555 static TinyVector<T, SIZE> zero() { \
1556 return TinyVector<T, SIZE>(NumericTraits<T>::zero()); \
1558 static TinyVector<T, SIZE> one() { \
1559 return TinyVector<T, SIZE>(NumericTraits<T>::one()); \
1561 static TinyVector<T, SIZE> nonZero() { \
1562 return TinyVector<T, SIZE>(NumericTraits<T>::nonZero()); \
1565 static Promote toPromote(TinyVector<T, SIZE> const & v) { \
1566 return Promote(v); \
1568 static RealPromote toRealPromote(TinyVector<T, SIZE> const & v) { \
1569 return RealPromote(v); \
1571 static TinyVector<T, SIZE> fromPromote(Promote const & v) { \
1572 TinyVector<T, SIZE> res;\
1573 TinyVector<T, SIZE>::iterator d = res.begin(), dend = res.end();\
1574 Promote::const_iterator s = v.begin();\
1575 for(; d != dend; ++d, ++s)\
1576 *d = NumericTraits<T>::fromPromote(*s);\
1579 static TinyVector<T, SIZE> fromRealPromote(RealPromote const & v) {\
1580 TinyVector<T, SIZE> res;\
1581 TinyVector<T, SIZE>::iterator d = res.begin(), dend = res.end();\
1582 RealPromote::const_iterator s = v.begin();\
1583 for(; d != dend; ++d, ++s)\
1584 *d = NumericTraits<T>::fromRealPromote(*s);\
1589 struct NormTraits<TinyVector<T, SIZE> >\
1591 typedef TinyVector<T, SIZE> Type;\
1592 typedef Type::SquaredNormType SquaredNormType; \
1593 typedef Type::NormType NormType; \
1596 #define TINYVECTOR_PROMTRAITS1(type1, SIZE) \
1598 struct PromoteTraits<TinyVector<type1, SIZE>, TinyVector<type1, SIZE> > \
1600 typedef TinyVector<PromoteTraits<type1, type1>::Promote, SIZE> Promote; \
1601 static Promote toPromote(TinyVector<type1, SIZE> const & v) { \
1602 return static_cast<Promote>(v); } \
1605 #define TINYVECTOR_PROMTRAITS2(type1, type2, SIZE) \
1607 struct PromoteTraits<TinyVector<type1, SIZE>, TinyVector<type2, SIZE> > \
1609 typedef TinyVector<PromoteTraits<type1, type2>::Promote, SIZE> Promote; \
1610 static Promote toPromote(TinyVector<type1, SIZE> const & v) { \
1611 return static_cast<Promote>(v); } \
1612 static Promote toPromote(TinyVector<type2, SIZE> const & v) { \
1613 return static_cast<Promote>(v); } \
1616 #define TINYVECTOR_TRAITS(SIZE) \
1617 TINYVECTOR_NUMTRAITS(unsigned char, SIZE)\
1618 TINYVECTOR_NUMTRAITS(int, SIZE)\
1619 TINYVECTOR_NUMTRAITS(float, SIZE)\
1620 TINYVECTOR_NUMTRAITS(double, SIZE)\
1621 TINYVECTOR_PROMTRAITS1(unsigned char, SIZE)\
1622 TINYVECTOR_PROMTRAITS1(int, SIZE)\
1623 TINYVECTOR_PROMTRAITS1(float, SIZE)\
1624 TINYVECTOR_PROMTRAITS1(double, SIZE)\
1625 TINYVECTOR_PROMTRAITS2(float, unsigned char, SIZE)\
1626 TINYVECTOR_PROMTRAITS2(unsigned char, float, SIZE)\
1627 TINYVECTOR_PROMTRAITS2(int, unsigned char, SIZE)\
1628 TINYVECTOR_PROMTRAITS2(unsigned char, int, SIZE)\
1629 TINYVECTOR_PROMTRAITS2(int, float, SIZE)\
1630 TINYVECTOR_PROMTRAITS2(float, int, SIZE)\
1631 TINYVECTOR_PROMTRAITS2(double, unsigned char, SIZE)\
1632 TINYVECTOR_PROMTRAITS2(unsigned char, double, SIZE)\
1633 TINYVECTOR_PROMTRAITS2(int, double, SIZE)\
1634 TINYVECTOR_PROMTRAITS2(double, int, SIZE)\
1635 TINYVECTOR_PROMTRAITS2(double, float, SIZE)\
1636 TINYVECTOR_PROMTRAITS2(float, double, SIZE)
1638 TINYVECTOR_TRAITS(2)
1639 TINYVECTOR_TRAITS(3)
1640 TINYVECTOR_TRAITS(4)
1642 #undef TINYVECTOR_NUMTRAITS
1643 #undef TINYVECTOR_PROMTRAITS1
1644 #undef TINYVECTOR_PROMTRAITS2
1645 #undef TINYVECTOR_TRAITS
1647 #endif // NO_PARTIAL_TEMPLATE_SPECIALIZATION
1661 template <
class V1,
int SIZE,
class D1,
class D2,
class V2,
class D3,
class D4>
1663 typename PromoteTraits<TinyVector<V1, SIZE>, TinyVector<V2, SIZE> >::Promote
1671 template <
class V1,
int SIZE,
class D1,
class D2,
class V2,
class D3,
class D4>
1673 typename PromoteTraits<TinyVector<V1, SIZE>, TinyVector<V2, SIZE> >::Promote
1681 template <
class V1,
int SIZE,
class D1,
class D2,
class V2,
class D3,
class D4>
1683 typename PromoteTraits<TinyVector<V1, SIZE>, TinyVector<V2, SIZE> >::Promote
1691 template <
class V1,
int SIZE,
class D1,
class D2,
class V2,
class D3,
class D4>
1693 typename PromoteTraits<TinyVector<V1, SIZE>, TinyVector<V2, SIZE> >::Promote
1701 template <
class V1,
int SIZE,
class D1,
class D2,
class V2,
class D3,
class D4>
1703 typename PromoteTraits<TinyVector<V1, SIZE>, TinyVector<V2, SIZE> >::Promote
1711 template <
class V,
int SIZE,
class D1,
class D2>
1713 typename NumericTraits<TinyVector<V, SIZE> >::RealPromote
1716 return typename NumericTraits<TinyVector<V, SIZE> >::RealPromote(r) *= v;
1720 template <
class V,
int SIZE,
class D1,
class D2>
1722 typename NumericTraits<TinyVector<V, SIZE> >::RealPromote
1725 return typename NumericTraits<TinyVector<V, SIZE> >::RealPromote(l) *= v;
1729 template <
class V,
int SIZE,
class D1,
class D2>
1731 typename NumericTraits<TinyVector<V, SIZE> >::RealPromote
1734 return typename NumericTraits<TinyVector<V, SIZE> >::RealPromote(l) /= v;
1738 template <
class V,
int SIZE,
class D1,
class D2>
1744 typedef typename detail::LoopType<SIZE>::type Loop;
1745 Loop::divScalar(result.data(), v);
1752 template <
class V,
int SIZE,
class D1,
class D2>
1758 typedef typename detail::LoopType<SIZE>::type ltype;
1759 ltype::neg(res.begin(), v.
begin());
1764 template <
class V,
int SIZE,
class D1,
class D2>
1770 typedef typename detail::LoopType<SIZE>::type ltype;
1777 template <
class V,
int SIZE,
class D1,
class D2>
1783 typedef typename detail::LoopType<SIZE>::type ltype;
1790 template <
class V,
int SIZE,
class D1,
class D2>
1796 typedef typename detail::LoopType<SIZE>::type ltype;
1803 template <
class V,
int SIZE,
class D1,
class D2>
1809 typedef typename detail::LoopType<SIZE>::type ltype;
1816 template <
class V,
int SIZE,
class D1,
class D2>
1822 typedef typename detail::LoopType<SIZE>::type ltype;
1831 template <
class V,
int SIZE,
class D1,
class D2,
class E>
1837 typedef typename detail::LoopType<SIZE>::type ltype;
1843 template <
class V1,
class D1,
class D2,
class V2,
class D3,
class D4>
1845 TinyVector<typename PromoteTraits<V1, V2>::Promote, 3>
1851 return Res(r1[1]*r2[2] - r1[2]*r2[1],
1852 r1[2]*r2[0] - r1[0]*r2[2],
1853 r1[0]*r2[1] - r1[1]*r2[0]);
1857 template <
class V1,
int SIZE,
class D1,
class D2,
class V2,
class D3,
class D4>
1859 typename PromoteTraits<V1, V2>::Promote
1863 typedef typename detail::LoopType<SIZE>::type ltype;
1868 template <
class V,
int SIZE,
class D1,
class D2>
1870 typename NumericTraits<V>::Promote
1873 typename NumericTraits<V>::Promote res = l[0];
1874 for(
int k=1; k<SIZE; ++k)
1880 template <
class V,
int SIZE,
class D1,
class D2>
1882 TinyVector<typename NumericTraits<V>::Promote, SIZE>
1886 for(
int k=1; k<SIZE; ++k)
1892 template <
class V,
int SIZE,
class D1,
class D2>
1894 typename NumericTraits<V>::Promote
1897 typename NumericTraits<V>::Promote res = l[0];
1898 for(
int k=1; k<SIZE; ++k)
1904 template <
class V,
int SIZE,
class D1,
class D2>
1906 TinyVector<typename NumericTraits<V>::Promote, SIZE>
1910 for(
int k=1; k<SIZE; ++k)
1918 template <
class V1,
int SIZE,
class D1,
class D2,
class V2,
class D3,
class D4>
1920 TinyVector<typename PromoteTraits<V1, V2>::Promote, SIZE>
1924 typedef typename detail::LoopType<SIZE>::type ltype;
1926 ltype::min(res.begin(), r.
begin());
1931 template <
class V1,
int SIZE,
class D1,
class D2>
1933 TinyVector<V1, SIZE>
1934 min(TinyVectorBase<V1, SIZE, D1, D2>
const & l,
1935 TinyVectorBase<V1, SIZE, D1, D2>
const & r)
1937 typedef typename detail::LoopType<SIZE>::type ltype;
1938 TinyVector<V1, SIZE> res(l);
1939 ltype::min(res.begin(), r.begin());
1943 template <
class V1,
int SIZE>
1945 TinyVector<V1, SIZE>
1946 min(TinyVector<V1, SIZE>
const & l,
1947 TinyVector<V1, SIZE>
const & r)
1949 typedef typename detail::LoopType<SIZE>::type ltype;
1950 TinyVector<V1, SIZE> res(l);
1951 ltype::min(res.begin(), r.begin());
1956 template <
class V,
int SIZE,
class D1,
class D2>
1967 template <
class V1,
int SIZE,
class D1,
class D2,
class V2,
class D3,
class D4>
1969 TinyVector<typename PromoteTraits<V1, V2>::Promote, SIZE>
1973 typedef typename detail::LoopType<SIZE>::type ltype;
1975 ltype::max(res.begin(), r.
begin());
1980 template <
class V1,
int SIZE,
class D1,
class D2>
1982 TinyVector<V1, SIZE>
1983 max(TinyVectorBase<V1, SIZE, D1, D2>
const & l,
1984 TinyVectorBase<V1, SIZE, D1, D2>
const & r)
1986 typedef typename detail::LoopType<SIZE>::type ltype;
1987 TinyVector<V1, SIZE> res(l);
1988 ltype::max(res.begin(), r.begin());
1992 template <
class V1,
int SIZE>
1994 TinyVector<V1, SIZE>
1995 max(TinyVector<V1, SIZE>
const & l,
1996 TinyVector<V1, SIZE>
const & r)
1998 typedef typename detail::LoopType<SIZE>::type ltype;
1999 TinyVector<V1, SIZE> res(l);
2000 ltype::max(res.begin(), r.begin());
2005 template <
class V,
int SIZE,
class D1,
class D2>
2014 template <
class V1,
int SIZE,
class D1,
class D2>
2016 typename TinyVectorBase<V1, SIZE, D1, D2>::SquaredNormType
2023 template <
class V,
int SIZE>
2025 typename TinyVector<V, SIZE>::SquaredNormType
2028 return t.squaredMagnitude();
2034 template <
class V,
int SIZE>
2045 #if defined(_MSC_VER)
2046 #pragma warning( pop )
2050 #undef VIGRA_ASSERT_INSIDE
2051 #endif // VIGRA_TINYVECTOR_HXX
NormType magnitude() const
Definition: tinyvector.hxx:776
const_reference operator[](difference_type i) const
Definition: tinyvector.hxx:827
DERIVED & operator/=(double r)
Definition: tinyvector.hxx:768
PromoteTraits< V1, V2 >::Promote dot(RGBValue< V1, RIDX1, GIDX1, BIDX1 > const &r1, RGBValue< V2, RIDX2, GIDX2, BIDX2 > const &r2)
dot product
Definition: rgbvalue.hxx:907
PromoteTraits< RGBValue< V1, R, G, B >, RGBValue< V2, R, G, B > >::Promote cross(RGBValue< V1, R, G, B > const &r1, RGBValue< V2, R, G, B > const &r2)
cross product
Definition: rgbvalue.hxx:890
TinyVectorView & operator=(TinyVectorView const &r)
Definition: tinyvector.hxx:1214
bool all() const
Definition: tinyvector.hxx:805
TinyVector(value_type const &initial)
Definition: tinyvector.hxx:940
int y
Definition: diff2d.hxx:392
VALUETYPE * pointer
Definition: tinyvector.hxx:658
Diff2D operator-(Diff2D const &a, Diff2D const &b)
Definition: diff2d.hxx:711
value_type const * const_iterator
Definition: tinyvector.hxx:670
double scalar_multiplier
Definition: tinyvector.hxx:682
VALUETYPE const * const_pointer
Definition: tinyvector.hxx:662
TinyVector(TinyVector const &r)
Definition: tinyvector.hxx:1036
DERIVED & operator+=(TinyVectorBase< T1, SIZE, D1, D2 > const &r)
Definition: tinyvector.hxx:716
TinyVector(TinyVectorBase< U, SIZE, DATA, DERIVED > const &r)
Definition: tinyvector.hxx:1068
void sub(FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r, FixedPoint< IntBits3, FracBits3 > &result)
subtraction with enforced result type.
Definition: fixedpoint.hxx:583
TinyVector(value_type const &i1, value_type const &i2, value_type const &i3, value_type const &i4, value_type const &i5)
Definition: tinyvector.hxx:1004
int x
Definition: diff2d.hxx:385
FFTWComplex< R >::SquaredNormType squaredNorm(const FFTWComplex< R > &a)
squared norm (= squared magnitude)
Definition: fftw3.hxx:1044
V power(const V &x)
Exponentiation to a positive integer power by squaring.
Definition: mathutil.hxx:389
const_iterator begin() const
Definition: tinyvector.hxx:842
const_iterator end() const
Definition: tinyvector.hxx:846
int round(FixedPoint< IntBits, FracBits > v)
rounding to the nearest integer.
Definition: fixedpoint.hxx:683
iterator end()
Definition: tinyvector.hxx:838
Diff2D operator+(Diff2D const &a, Diff2D const &b)
Definition: diff2d.hxx:739
Two dimensional difference vector.
Definition: diff2d.hxx:185
void add(FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r, FixedPoint< IntBits3, FracBits3 > &result)
addition with enforced result type.
Definition: fixedpoint.hxx:561
SquaredNormType squaredMagnitude() const
Definition: tinyvector.hxx:784
TinyVector(Diff2D const &initial)
Definition: tinyvector.hxx:960
TinyVector(const_pointer data, ReverseCopyTag)
Definition: tinyvector.hxx:1059
DERIVED & operator/=(TinyVectorBase< T1, SIZE, D1, D2 > const &r)
Definition: tinyvector.hxx:743
TinyVector & copy(TinyVectorBase< U, USIZE, DATA, DERIVED > const &r)
Definition: tinyvector.hxx:1115
value_type * iterator
Definition: tinyvector.hxx:666
DERIVED & operator*=(double r)
Definition: tinyvector.hxx:760
DERIVED & operator-=(TinyVectorBase< T1, SIZE, D1, D2 > const &r)
Definition: tinyvector.hxx:725
TinyVector & operator=(TinyVector const &r)
Definition: tinyvector.hxx:1076
TinyVector()
Definition: tinyvector.hxx:1018
VALUETYPE value_type
Definition: tinyvector.hxx:646
void mul(FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r, FixedPoint< IntBits3, FracBits3 > &result)
multiplication with enforced result type.
Definition: fixedpoint.hxx:605
NumericTraits< V >::Promote prod(TinyVectorBase< V, SIZE, D1, D2 > const &l)
product of the vector's elements
Definition: tinyvector.hxx:1895
TinyVectorView(TinyVectorBase< T, SIZE, DATA, DERIVED > const &other)
Definition: tinyvector.hxx:1206
NumericTraits< V >::Promote sum(TinyVectorBase< V, SIZE, D1, D2 > const &l)
sum of the vector's elements
Definition: tinyvector.hxx:1871
TinyVector(value_type const &i1, value_type const &i2, value_type const &i3, value_type const &i4)
Definition: tinyvector.hxx:991
TinyVectorView()
Definition: tinyvector.hxx:1181
bool operator!=(FFTWComplex< R > const &a, const FFTWComplex< R > &b)
not equal
Definition: fftw3.hxx:841
void init(value_type initial)
Definition: tinyvector.hxx:708
VALUETYPE & reference
Definition: tinyvector.hxx:650
iterator begin()
Definition: tinyvector.hxx:835
bool operator==(FFTWComplex< R > const &a, const FFTWComplex< R > &b)
equal
Definition: fftw3.hxx:825
size_type size() const
Definition: tinyvector.hxx:865
VALUETYPE const & const_reference
Definition: tinyvector.hxx:654
TinyVector & operator=(value_type const &v)
Definition: tinyvector.hxx:1104
TinyVector(value_type const &i1, value_type const &i2, value_type const &i3)
Definition: tinyvector.hxx:980
TinyVector(SkipInitializationTag)
Definition: tinyvector.hxx:1026
TinyVectorView & operator=(TinyVectorBase< U, SIZE, DATA, DERIVED > const &r)
Definition: tinyvector.hxx:1223
TinyVector< typename NumericTraits< V >::Promote, SIZE > cumsum(TinyVectorBase< V, SIZE, D1, D2 > const &l)
cumulative sum of the vector's elements
Definition: tinyvector.hxx:1883
Wrapper for fixed size vectors.
Definition: tinyvector.hxx:612
Class for fixed size vectors.This class contains an array of size SIZE of the specified VALUETYPE...
Definition: accessor.hxx:940
NormTraits< T >::SquaredNormType dot(const MultiArrayView< 2, T, C1 > &x, const MultiArrayView< 2, T, C2 > &y)
Definition: matrix.hxx:1340
bool closeAtTolerance(T1 l, T2 r, typename PromoteTraits< T1, T2 >::Promote epsilon)
Tolerance based floating-point comparison.
Definition: mathutil.hxx:1600
FixedPoint16< IntBits3, OverflowHandling > & div(FixedPoint16< IntBits1, OverflowHandling > l, FixedPoint16< IntBits2, OverflowHandling > r, FixedPoint16< IntBits3, OverflowHandling > &result)
division with enforced result type.
Definition: fixedpoint.hxx:1616
unsigned int size_type
Definition: tinyvector.hxx:674
TinyVectorView< VALUETYPE, TO-FROM > subarray() const
Definition: tinyvector.hxx:853
TinyVectorView(TinyVectorView const &other)
Definition: tinyvector.hxx:1197
Base class for fixed size vectors.
Definition: tinyvector.hxx:81
FFTWComplex< R >::NormType abs(const FFTWComplex< R > &a)
absolute value (= magnitude)
Definition: fftw3.hxx:1002
TinyVector(U const *data)
Definition: tinyvector.hxx:1045
SquareRootTraits< SquaredNormType >::SquareRootResult NormType
Definition: tinyvector.hxx:690
VALUETYPE const & maximum() const
Definition: tinyvector.hxx:798
std::ptrdiff_t difference_type
Definition: tinyvector.hxx:678
bool any() const
Definition: tinyvector.hxx:812
TinyVector(value_type const &i1, value_type const &i2)
Definition: tinyvector.hxx:970
int ceil(FixedPoint< IntBits, FracBits > v)
rounding up.
Definition: fixedpoint.hxx:675
TinyVector< V, SIZE > reverse(TinyVector< V, SIZE > const &t)
reversed copy
Definition: tinyvector.hxx:2037
TinyVectorView(const_pointer data)
Definition: tinyvector.hxx:1189
TinyVector & operator=(TinyVectorBase< U, SIZE, DATA, DERIVED > const &r)
Definition: tinyvector.hxx:1085
int floor(FixedPoint< IntBits, FracBits > v)
rounding down.
Definition: fixedpoint.hxx:667
TinyVector< typename NumericTraits< V >::Promote, SIZE > cumprod(TinyVectorBase< V, SIZE, D1, D2 > const &l)
cumulative product of the vector's elements
Definition: tinyvector.hxx:1907
VALUETYPE const & minimum() const
Definition: tinyvector.hxx:791
DERIVED & operator%=(TinyVectorBase< T1, SIZE, D1, D2 > const &r)
Definition: tinyvector.hxx:752
void init(Iterator i, Iterator end)
Definition: tinyvector.hxx:699
NormTraits< VALUETYPE >::SquaredNormType SquaredNormType
Definition: tinyvector.hxx:686
DERIVED & operator*=(TinyVectorBase< T1, SIZE, D1, D2 > const &r)
Definition: tinyvector.hxx:734
TinyVector & operator=(Diff2D const &r)
Definition: tinyvector.hxx:1095
reference operator[](difference_type i)
Definition: tinyvector.hxx:819
SquareRootTraits< FixedPoint< IntBits, FracBits > >::SquareRootResult sqrt(FixedPoint< IntBits, FracBits > v)
square root.
Definition: fixedpoint.hxx:616
PromoteTraits< TinyVector< V1, SIZE >, TinyVector< V2, SIZE > >::Promote operator%(TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
component-wise modulo
Definition: tinyvector.hxx:1704
TinyVector(lemon::Invalid const &)
Definition: tinyvector.hxx:950