SLAMflex SE  0.1.0
SLAMflex provides detection and tracking of dominant planes for smartphone devices. This plane can then be used to show AR content relative to the plane orientation. The detection of plane is performed in the field of view of the smartphone camera. In subsequent frames it is tracked. The interface returns the plane position and orientation.
operators.hh
Go to the documentation of this file.
1 //-*- c++ -*-
2 
3 // Copyright (C) 2009 Tom Drummond (twd20@cam.ac.uk),
4 // Ed Rosten (er258@cam.ac.uk)
5 //
6 // This file is part of the TooN Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 2, or (at your option)
10 // any later version.
11 
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 
17 // You should have received a copy of the GNU General Public License along
18 // with this library; see the file COPYING. If not, write to the Free
19 // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
20 // USA.
21 
22 // As a special exception, you may use this file as part of a free software
23 // library without restriction. Specifically, if other files instantiate
24 // templates or use macros or inline functions from this file, or you compile
25 // this file and link it with other files to produce an executable, this
26 // file does not by itself cause the resulting executable to be covered by
27 // the GNU General Public License. This exception does not however
28 // invalidate any other reasons why the executable file might be covered by
29 // the GNU General Public License.
30 
31 namespace TooN {
32 
34 // Type and size computation for scalar operations used in this file
36 
37 namespace Internal {
38 
39  //Automatic type deduction of return types
43  template<class C> C gettype();
44 
49  template<class L, class R> struct Field
50  {
52  static const int is = IsField<L>::value && IsField<R>::value;
53  };
54 
55 
56  //We have to use the traits here because it is not possible to
57  //check for the existence of a valid operator *, especially
58  //in the presence of builtin operators. Therefore, the type is
59  //only deduced if both of the input types are fields.
60  template<class L, class R, int F = Field<L,R>::is> struct AddType { typedef TOON_TYPEOF(gettype<L>()+gettype<R>()) type;};
61  template<class L, class R, int F = Field<L,R>::is> struct SubtractType { typedef TOON_TYPEOF(gettype<L>()-gettype<R>()) type;};
62  template<class L, class R, int F = Field<L,R>::is> struct MultiplyType { typedef TOON_TYPEOF(gettype<L>()*gettype<R>()) type;};
63  template<class L, class R, int F = Field<L,R>::is> struct DivideType { typedef TOON_TYPEOF(gettype<L>()/gettype<R>()) type;};
64 
65  template<class L, class R> struct AddType<L, R, 0> { typedef These_Types_Do_Not_Form_A_Field<L, R> type;};
66  template<class L, class R> struct SubtractType<L, R, 0> { typedef These_Types_Do_Not_Form_A_Field<L, R> type;};
67  template<class L, class R> struct MultiplyType<L, R, 0> { typedef These_Types_Do_Not_Form_A_Field<L, R> type;};
68  template<class L, class R> struct DivideType<L, R, 0> { typedef These_Types_Do_Not_Form_A_Field<L, R> type;};
69 
70 
71  //Mini operators for passing to Pairwise, etc
72  struct Add{
73  template<class A, class B, class C> static A op(const B& b, const C& c){return b+c;}
74  template<class P1, class P2> struct Return { typedef typename AddType<P1,P2>::type Type;};
75  };
76  struct Subtract{
77  template<class A, class B, class C> static A op(const B& b, const C& c){return b-c;}
78  template<class P1, class P2> struct Return { typedef typename SubtractType<P1,P2>::type Type;};
79  };
80  struct Multiply{
81  template<class A, class B, class C> static A op(const B& b, const C& c){return b*c;}
82  template<class P1, class P2> struct Return { typedef typename MultiplyType<P1,P2>::type Type;};
83  };
84  struct Divide{
85  template<class A, class B, class C> static A op(const B& b, const C& c){return b/c;}
86  template<class P1, class P2> struct Return { typedef typename DivideType<P1,P2>::type Type;};
87  };
88 
89 };
90 
92 // Operators
94 
95 template<class Op> struct Operator{};
96 
97 
99 // Vector <op> Vector
101 
102 namespace Internal {
103  template<typename Op, // the operation
104  int S1, typename P1, typename B1, // lhs vector
105  int S2, typename P2, typename B2> // rhs vector
106  struct VPairwise;
107 
108  template <int S, typename P, typename A> // input vector
109  struct VNegate;
110 };
111 
112 template<typename Op, // the operation
113  int S1, typename P1, typename B1, // lhs vector
114  int S2, typename P2, typename B2> // rhs vector
115 struct Operator<Internal::VPairwise<Op, S1, P1, B1, S2, P2, B2> > {
118 
119  Operator(const Vector<S1, P1, B1> & lhs_in, const Vector<S2, P2, B2> & rhs_in) : lhs(lhs_in), rhs(rhs_in) {}
120 
121  template<int S0, typename P0, typename Ba0>
122  void eval(Vector<S0, P0, Ba0>& res) const
123  {
124  for(int i=0; i < res.size(); ++i)
125  res[i] = Op::template op<P0,P1, P2>(lhs[i],rhs[i]);
126  }
127  int size() const {return lhs.size();}
128 };
129 
130 // Addition Vector + Vector
131 template<int S1, int S2, typename P1, typename P2, typename B1, typename B2>
132 Vector<Internal::Sizer<S1,S2>::size, typename Internal::AddType<P1, P2>::type>
134 {
135  SizeMismatch<S1, S2>:: test(v1.size(),v2.size());
137 }
138 
139 // Subtraction Vector - Vector
140 template<int S1, int S2, typename P1, typename P2, typename B1, typename B2>
141 Vector<Internal::Sizer<S1,S2>::size, typename Internal::SubtractType<P1, P2>::type> operator-(const Vector<S1, P1, B1>& v1, const Vector<S2, P2, B2>& v2)
142 {
143  SizeMismatch<S1, S2>:: test(v1.size(),v2.size());
145 }
146 
147 // diagmult Vector, Vector
148 template <int S1, int S2, typename P1, typename P2, typename B1, typename B2>
149 Vector<Internal::Sizer<S1,S2>::size, typename Internal::MultiplyType<P1,P2>::type> diagmult(const Vector<S1,P1,B1>& v1, const Vector<S2,P2,B2>& v2)
150 {
151  SizeMismatch<S1,S2>::test(v1.size(),v2.size());
153 }
154 
155 template<int S, typename P, typename A>
156 struct Operator<Internal::VNegate<S, P, A> > {
158  Operator( const Vector<S, P, A> & in ) : input(in) {}
159 
160  template<int S0, typename P0, typename A0>
161  void eval(Vector<S0, P0, A0> & res) const
162  {
163  res = input * -1;
164  }
165  int size() const { return input.size(); }
166 };
167 
168 // Negation -Vector
169 template <int S, typename P, typename A>
172 }
173 
174 // Dot product Vector * Vector
175 template<int Size1, typename Precision1, typename Base1, int Size2, typename Precision2, typename Base2>
177  SizeMismatch<Size1, Size2>:: test(v1.size(),v2.size());
178  const int s=v1.size();
180  for(int i=0; i<s; i++){
181  result+=v1[i]*v2[i];
182  }
183  return result;
184 }
185 
186 template <typename P1, typename P2, typename B1, typename B2>
188  // assume the result of adding two restypes is also a restype
189  typedef typename Internal::MultiplyType<P1,P2>::type restype;
190 
191  Vector<3, restype> result;
192 
193  result[0] = v1[1]*v2[2] - v1[2]*v2[1];
194  result[1] = v1[2]*v2[0] - v1[0]*v2[2];
195  result[2] = v1[0]*v2[1] - v1[1]*v2[0];
196 
197  return result;
198 }
199 
200 
201 
202 
204 // Matrix <op> Matrix
206 
207 namespace Internal {
208  template<typename Op, // the operation
209  int R1, int C1, typename P1, typename B1, // lhs matrix
210  int R2, int C2, typename P2, typename B2> // rhs matrix
211  struct MPairwise;
212 
213  template<int R1, int C1, typename P1, typename B1, // lhs matrix
214  int R2, int C2, typename P2, typename B2> // rhs matrix
216 
217  template<int R, int C, typename P, typename A> // input matrix
218  struct MNegate;
219 };
220 
221 template<typename Op, // the operation
222  int R1, int C1, typename P1, typename B1, // lhs matrix
223  int R2, int C2, typename P2, typename B2> // rhs matrix
224 struct Operator<Internal::MPairwise<Op, R1, C1, P1, B1, R2, C2, P2, B2> > {
227 
228  Operator(const Matrix<R1, C1, P1, B1> & lhs_in, const Matrix<R2, C2, P2, B2> & rhs_in) : lhs(lhs_in), rhs(rhs_in) {}
229 
230  template<int R0, int C0, typename P0, typename Ba0>
231  void eval(Matrix<R0, C0, P0, Ba0>& res) const
232  {
233  for(int r=0; r < res.num_rows(); ++r){
234  for(int c=0; c < res.num_cols(); ++c){
235  res(r,c) = Op::template op<P0,P1, P2>(lhs(r,c),rhs(r,c));
236  }
237  }
238  }
239  int num_rows() const {return lhs.num_rows();}
240  int num_cols() const {return lhs.num_cols();}
241 };
242 
243 // Addition Matrix + Matrix
244 template<int R1, int R2, int C1, int C2, typename P1, typename P2, typename B1, typename B2>
245 Matrix<Internal::Sizer<R1,R2>::size, Internal::Sizer<C1,C2>::size, typename Internal::AddType<P1, P2>::type>
247 {
248  SizeMismatch<R1, R2>:: test(m1.num_rows(),m2.num_rows());
249  SizeMismatch<C1, C2>:: test(m1.num_cols(),m2.num_cols());
251 }
252 
253 // Subtraction Matrix - Matrix
254 template<int R1, int R2, int C1, int C2, typename P1, typename P2, typename B1, typename B2>
255 Matrix<Internal::Sizer<R1,R2>::size, Internal::Sizer<C1,C2>::size, typename Internal::SubtractType<P1, P2>::type>
257 {
258  SizeMismatch<R1, R2>:: test(m1.num_rows(),m2.num_rows());
259  SizeMismatch<C1, C2>:: test(m1.num_cols(),m2.num_cols());
261 }
262 
263 template<int R, int C, typename P, typename A>
264 struct Operator<Internal::MNegate<R,C, P, A> > {
266  Operator( const Matrix<R,C,P,A> & in ) : input(in) {}
267 
268  template<int R0, int C0, typename P0, typename A0>
269  void eval(Matrix<R0,C0,P0,A0> & res) const
270  {
271  res = input * -1;
272  }
273  int num_rows() const { return input.num_rows(); }
274  int num_cols() const { return input.num_cols(); }
275 };
276 
277 // Negation -Matrix
278 template <int R, int C, typename P, typename A>
281 }
282 
283 template<int R1, int C1, typename P1, typename B1, // lhs matrix
284  int R2, int C2, typename P2, typename B2> // rhs matrix
285 struct Operator<Internal::MatrixMultiply<R1, C1, P1, B1, R2, C2, P2, B2> > {
288 
289  Operator(const Matrix<R1, C1, P1, B1> & lhs_in, const Matrix<R2, C2, P2, B2> & rhs_in) : lhs(lhs_in), rhs(rhs_in) {}
290 
291  template<int R0, int C0, typename P0, typename Ba0>
292  void eval(Matrix<R0, C0, P0, Ba0>& res) const
293  {
294 
295  for(int r=0; r < res.num_rows(); ++r) {
296  for(int c=0; c < res.num_cols(); ++c) {
297  res(r,c) = lhs[r] * (rhs.T()[c]);
298  }
299  }
300  }
301  int num_rows() const {return lhs.num_rows();}
302  int num_cols() const {return rhs.num_cols();}
303 };
304 
305 
306 
307 
308 // Matrix multiplication Matrix * Matrix
309 
310 template<int R1, int C1, int R2, int C2, typename P1, typename P2, typename B1, typename B2>
312 {
313  SizeMismatch<C1, R2>:: test(m1.num_cols(),m2.num_rows());
315 }
316 
318 // matrix <op> vector and vv.
320 
321 
322 namespace Internal {
323  // dummy struct for Vector * Matrix
324  template<int R, int C, typename P1, typename B1, int Size, typename P2, typename B2>
326 
327  // this is distinct to cater for non commuting precision types
328  template<int Size, typename P1, typename B1, int R, int C, typename P2, typename B2>
330 
331  // dummy struct for Vector * Matrix
332  template<int R, int C, typename P1, typename B1, int Size, typename P2, typename B2>
334 
335  // this is distinct to cater for non commuting precision types
336  template<int Size, typename P1, typename B1, int R, int C, typename P2, typename B2>
338 
339 };
340 
341 // Matrix Vector multiplication Matrix * Vector
342 template<int R, int C, typename P1, typename B1, int Size, typename P2, typename B2>
343 struct Operator<Internal::MatrixVectorMultiply<R,C,P1,B1,Size,P2,B2> > {
346 
347  Operator(const Matrix<R,C,P1,B1>& lhs_in, const Vector<Size,P2,B2>& rhs_in) : lhs(lhs_in), rhs(rhs_in) {}
348 
349  int size() const {return lhs.num_rows();}
350 
351  template<int Sout, typename Pout, typename Bout>
352  void eval(Vector<Sout, Pout, Bout>& res) const {
353  for(int i=0; i < res.size(); ++i){
354  res[i] = lhs[i] * rhs;
355  }
356  }
357 };
358 
359 template<int R, int C, int Size, typename P1, typename P2, typename B1, typename B2>
361 {
362  SizeMismatch<C,Size>::test(m.num_cols(), v.size());
364 }
365 
366 // Vector Matrix multiplication Vector * Matrix
367 template<int R, int C, typename P1, typename B1, int Size, typename P2, typename B2>
368 struct Operator<Internal::VectorMatrixMultiply<Size,P1,B1,R,C,P2,B2> > {
371 
372  Operator(const Vector<Size,P1,B1>& lhs_in, const Matrix<R,C,P2,B2>& rhs_in) : lhs(lhs_in), rhs(rhs_in) {}
373 
374  int size() const {return rhs.num_cols();}
375 
376  template<int Sout, typename Pout, typename Bout>
377  void eval(Vector<Sout, Pout, Bout>& res) const {
378  for(int i=0; i < res.size(); ++i){
379  res[i] = lhs * rhs.T()[i];
380  }
381  }
382 };
383 
384 template<int R, int C, typename P1, typename B1, int Size, typename P2, typename B2>
386  const Matrix<R,C,P2,B2>& m)
387 {
388  SizeMismatch<C,Size>::test(m.num_rows(), v.size());
390 }
391 
392 
393 // Matrix Vector diagonal multiplication Matrix * Vector
394 template<int R, int C, typename P1, typename B1, int Size, typename P2, typename B2>
395 struct Operator<Internal::MatrixVectorDiagMultiply<R,C,P1,B1,Size,P2,B2> > {
398 
399  Operator(const Matrix<R,C,P1,B1>& lhs_in, const Vector<Size,P2,B2>& rhs_in) : lhs(lhs_in), rhs(rhs_in) {}
400 
401  int num_rows() const {return lhs.num_rows();}
402  int num_cols() const {return lhs.num_cols();}
403 
404  template<int Rout, int Cout, typename Pout, typename Bout>
406  for(int c=0; c < res.num_cols(); ++c) {
407  P2 temp = rhs[c];
408  for(int r=0; r < res.num_rows(); ++r) {
409  res(r,c) = lhs(r,c)*temp;
410  }
411  }
412  }
413 };
414 
415 template<int R, int C, int Size, typename P1, typename P2, typename B1, typename B2>
417 {
418  SizeMismatch<C,Size>::test(m.num_cols(), v.size());
420 }
421 
422 // Vector Matrix diagonal multiplication Vector * Matrix
423 template<int R, int C, typename P1, typename B1, int Size, typename P2, typename B2>
424 struct Operator<Internal::VectorMatrixDiagMultiply<Size,P1,B1,R,C,P2,B2> > {
427 
428  Operator(const Vector<Size,P1,B1>& lhs_in, const Matrix<R,C,P2,B2>& rhs_in) : lhs(lhs_in), rhs(rhs_in) {}
429 
430  int num_rows() const {return rhs.num_rows();}
431  int num_cols() const {return rhs.num_cols();}
432 
433  template<int Rout, int Cout, typename Pout, typename Bout>
435  for(int r=0; r < res.num_rows(); ++r){
436  const P1 temp = lhs[r];
437  for(int c=0; c<res.num_cols(); ++c){
438  res(r,c) = temp * rhs(r,c);
439  }
440  }
441  }
442 };
443 
444 template<int R, int C, typename P1, typename B1, int Size, typename P2, typename B2>
446  const Matrix<R,C,P2,B2>& m)
447 {
448  SizeMismatch<R,Size>::test(m.num_rows(), v.size());
450 }
451 
452 
454 //
455 // vector <op> scalar
456 // scalar <op> vector
457 // matrix <op> scalar
458 // scalar <op> matrix
459 //
460 // Except <scalar> / <matrix|vector> does not exist
461 
462 namespace Internal {
463  template<int Size, typename P1, typename B1, typename P2, typename Op>
464  struct ApplyScalarV;
465 
466  template<int Size, typename P1, typename B1, typename P2, typename Op>
468 
469  template<int R, int C, typename P1, typename B1, typename P2, typename Op>
470  struct ApplyScalarM;
471 
472  template<int R, int C, typename P1, typename B1, typename P2, typename Op>
474 };
475 
476 template<int Size, typename P1, typename B1, typename P2, typename Op>
477 struct Operator<Internal::ApplyScalarV<Size,P1,B1,P2,Op> > {
479  const P2& rhs;
480 
481  Operator(const Vector<Size,P1,B1>& v, const P2& s) : lhs(v), rhs(s) {}
482 
483  template<int S0, typename P0, typename Ba0>
484  void eval(Vector<S0,P0,Ba0>& v) const {
485  for(int i=0; i<v.size(); i++){
486  v[i]= Op::template op<P0,P1,P2> (lhs[i],rhs);
487  }
488  }
489 
490  int size() const {
491  return lhs.size();
492  }
493 };
494 
495 template <int Size, typename P1, typename B1, typename P2>
498 }
499 template <int Size, typename P1, typename B1, typename P2>
502 }
503 
504 template<int Size, typename P1, typename B1, typename P2, typename Op>
505 struct Operator<Internal::ApplyScalarVL<Size,P1,B1,P2,Op> > {
506  const P2& lhs;
508 
509  Operator(const P2& s, const Vector<Size,P1,B1>& v) : lhs(s), rhs(v) {}
510 
511  template<int S0, typename P0, typename Ba0>
512  void eval(Vector<S0,P0,Ba0>& v) const {
513  for(int i=0; i<v.size(); i++){
514  v[i]= Op::template op<P0,P2,P1> (lhs,rhs[i]);
515  }
516  }
517 
518  int size() const {
519  return rhs.size();
520  }
521 };
522 template <int Size, typename P1, typename B1, typename P2>
525 }
526 // no left division
527 
528 
530 
531 template<int R, int C, typename P1, typename B1, typename P2, typename Op>
532 struct Operator<Internal::ApplyScalarM<R,C,P1,B1,P2,Op> > {
534  const P2& rhs;
535 
536  Operator(const Matrix<R,C,P1,B1>& m, const P2& s) : lhs(m), rhs(s) {}
537 
538  template<int R0, int C0, typename P0, typename Ba0>
539  void eval(Matrix<R0,C0,P0,Ba0>& m) const {
540  for(int r=0; r<m.num_rows(); r++){
541  for(int c=0; c<m.num_cols(); c++){
542  m(r,c)= Op::template op<P0,P1,P2> (lhs(r,c),rhs);
543  }
544  }
545  }
546 
547  int num_rows() const {
548  return lhs.num_rows();
549  }
550  int num_cols() const {
551  return lhs.num_cols();
552  }
553 };
554 
555 template <int R, int C, typename P1, typename B1, typename P2>
558 }
559 template <int R, int C, typename P1, typename B1, typename P2>
562 }
563 
564 template<int R, int C, typename P1, typename B1, typename P2, typename Op>
565 struct Operator<Internal::ApplyScalarML<R,C,P1,B1,P2,Op> > {
566  const P2& lhs;
568 
569  Operator( const P2& s,const Matrix<R,C,P1,B1>& m) : lhs(s), rhs(m) {}
570 
571  template<int R0, int C0, typename P0, typename Ba0>
572  void eval(Matrix<R0,C0,P0,Ba0>& m) const {
573  for(int r=0; r<m.num_rows(); r++){
574  for(int c=0; c<m.num_cols(); c++){
575  m(r,c)= Op::template op<P0,P1,P2> (lhs,rhs(r,c));
576  }
577  }
578  }
579 
580  int num_rows() const {
581  return rhs.num_rows();
582  }
583  int num_cols() const {
584  return rhs.num_cols();
585  }
586 };
587 
588 template <int R, int C, typename P1, typename B1, typename P2>
591 }
592 
594 //
595 // Addition of operators
596 //
597 template <int Size, typename P1, typename B1, typename Op>
599  return op.add(v);
600 }
601 
602 template <int Size, typename P1, typename B1, typename Op>
604  return op.add(v);
605 }
606 
607 template <int Rows, int Cols, typename P1, typename B1, typename Op>
609  return op.add(m);
610 }
611 
612 template <int Rows, int Cols, typename P1, typename B1, typename Op>
614  return op.add(m);
615 }
616 
617 
618 
619 
620 template <int Size, typename P1, typename B1, typename Op>
622  return op.rsubtract(v);
623 }
624 
625 template <int Size, typename P1, typename B1, typename Op>
627  return op.lsubtract(v);
628 }
629 
630 template <int Rows, int Cols, typename P1, typename B1, typename Op>
632  return op.rsubtract(m);
633 }
634 
635 template <int Rows, int Cols, typename P1, typename B1, typename Op>
637  return op.lsubtract(m);
638 }
640 //
641 // Stream I/O operators
642 //
643 
644 // output operator <<
645 template <int Size, typename Precision, typename Base>
646 inline std::ostream& operator<< (std::ostream& os, const Vector<Size,Precision,Base>& v){
647  std::streamsize fw = os.width();
648  for(int i=0; i<v.size(); i++){
649  os.width(fw);
650  os << v[i] << " ";
651  }
652  return os;
653 }
654 
655 // operator istream& >>
656 template <int Size, typename Precision, typename Base>
657 std::istream& operator >> (std::istream& is, Vector<Size, Precision, Base>& v){
658  for (int i=0; i<v.size(); i++){
659  is >> v[i];
660  }
661  return is;
662 }
663 
664 template<int Rows, int Cols, typename Precision, class Base>
665 inline std::ostream& operator<< (std::ostream& os, const Matrix<Rows, Cols, Precision, Base>& m){
666  std::streamsize fw = os.width();
667  for(int i=0; i < m.num_rows(); i++)
668  {
669  for(int j=0; j < m.num_cols(); j++)
670  {
671  if(j != 0)
672  os << " ";
673  os.width(fw);
674  os << m(i,j);
675  }
676  os << std::endl;
677  }
678  return os;
679 }
680 
681 // operator istream& >>
682 template <int Rows, int Cols, typename Precision, typename Base>
683 std::istream& operator >> (std::istream& is, Matrix<Rows, Cols, Precision, Base>& m){
684  for(int r=0; r<m.num_rows(); r++){
685  for(int c=0; c < m.num_cols(); c++){
686  is >> m(r,c);
687  }
688  }
689  return is;
690 }
691 
692 }
Operator(const Vector< Size, P1, B1 > &lhs_in, const Matrix< R, C, P2, B2 > &rhs_in)
Definition: operators.hh:428
static const int is
Definition: operators.hh:52
Operator(const Vector< S, P, A > &in)
Definition: operators.hh:158
Operator< Op< typename Internal::DivideType< Pl, Pr >::type > > operator/(const Operator< Op< Pl > > &l, const Pr &r)
Definition: objects.h:675
These_Types_Do_Not_Form_A_Field< L, R > type
Definition: operators.hh:65
These_Types_Do_Not_Form_A_Field< L, R > type
Definition: operators.hh:67
static A op(const B &b, const C &c)
Definition: operators.hh:73
void eval(Vector< S0, P0, A0 > &res) const
Definition: operators.hh:161
static A op(const B &b, const C &c)
Definition: operators.hh:85
Vector< Internal::Sizer< S1, S2 >::size, typename Internal::AddType< P1, P2 >::type > operator+(const Vector< S1, P1, B1 > &v1, const Vector< S2, P2, B2 > &v2)
Definition: operators.hh:133
Everything lives inside this namespace.
Definition: allocator.hh:48
Operator(const Matrix< R1, C1, P1, B1 > &lhs_in, const Matrix< R2, C2, P2, B2 > &rhs_in)
Definition: operators.hh:289
static void test(int s1, int s2)
SubtractType< P1, P2 >::type Type
Definition: operators.hh:78
DivideType< P1, P2 >::type Type
Definition: operators.hh:86
Operator(const Vector< S1, P1, B1 > &lhs_in, const Vector< S2, P2, B2 > &rhs_in)
Definition: operators.hh:119
Vector< 3, typename Internal::MultiplyType< P1, P2 >::type > operator^(const Vector< 3, P1, B1 > &v1, const Vector< 3, P2, B2 > &v2)
Definition: operators.hh:187
Operator(const Matrix< R, C, P1, B1 > &m, const P2 &s)
Definition: operators.hh:536
void eval(Matrix< R0, C0, P0, A0 > &res) const
Definition: operators.hh:269
typedef TOON_TYPEOF(gettype< L >()-gettype< R >()) type
These_Types_Do_Not_Form_A_Field< L, R > type
Definition: operators.hh:68
void eval(Matrix< R0, C0, P0, Ba0 > &m) const
Definition: operators.hh:572
typedef TOON_TYPEOF(gettype< L >()*gettype< R >()) type
Operator< Op > operator-(const Operator< Op > &o)
Definition: objects.h:682
Operator(const Vector< Size, P1, B1 > &lhs_in, const Matrix< R, C, P2, B2 > &rhs_in)
Definition: operators.hh:372
static A op(const B &b, const C &c)
Definition: operators.hh:77
Operator(const Matrix< R, C, P, A > &in)
Definition: operators.hh:266
Operator(const P2 &s, const Vector< Size, P1, B1 > &v)
Definition: operators.hh:509
void eval(Matrix< R0, C0, P0, Ba0 > &m) const
Definition: operators.hh:539
Operator(const Matrix< R, C, P1, B1 > &lhs_in, const Vector< Size, P2, B2 > &rhs_in)
Definition: operators.hh:399
AddType< P1, P2 >::type Type
Definition: operators.hh:74
Operator(const Vector< Size, P1, B1 > &v, const P2 &s)
Definition: operators.hh:481
std::istream & operator>>(std::istream &is, Vector< Size, Precision, Base > &v)
Definition: operators.hh:657
Operator(const P2 &s, const Matrix< R, C, P1, B1 > &m)
Definition: operators.hh:569
Operator(const Matrix< R1, C1, P1, B1 > &lhs_in, const Matrix< R2, C2, P2, B2 > &rhs_in)
Definition: operators.hh:228
Vector< Internal::Sizer< S1, S2 >::size, typename Internal::MultiplyType< P1, P2 >::type > operator*(const DiagonalMatrix< S1, P1, B1 > &d, const Vector< S2, P2, B2 > &v)
Definition: diagmatrix.h:111
typedef TOON_TYPEOF(gettype< L >()+gettype< R >()) type
MultiplyType< P1, P2 >::type Type
Definition: operators.hh:82
Vector< Internal::Sizer< S1, S2 >::size, typename Internal::MultiplyType< P1, P2 >::type > diagmult(const Vector< S1, P1, B1 > &v1, const Vector< S2, P2, B2 > &v2)
Definition: operators.hh:149
typedef TOON_TYPEOF(gettype< L >()/gettype< R >()) type
Operator(const Matrix< R, C, P1, B1 > &lhs_in, const Vector< Size, P2, B2 > &rhs_in)
Definition: operators.hh:347
These_Types_Do_Not_Form_A_Field< L, R > type
Definition: operators.hh:66
static A op(const B &b, const C &c)
Definition: operators.hh:81