5 #ifndef OPENCV_CORE_MATX_INL_HPP
6 #define OPENCV_CORE_MATX_INL_HPP
9 # error matx.inl.hpp header must be compiled as C++
12 #include "opencv2/core/matx.hpp"
28 double p =
LU(
temp.val, m*
sizeof(_Tp), m, 0, 0, 0);
31 for(
int i = 0; i < m; i++ )
49 return a(0,0)*a(1,1) - a(0,1)*a(1,0);
57 return a(0,0)*(a(1,1)*a(2,2) - a(2,1)*a(1,2)) -
58 a(0,1)*(a(1,0)*a(2,2) - a(2,0)*a(1,2)) +
59 a(0,2)*(a(1,0)*a(2,1) - a(2,0)*a(1,1));
79 template<
typename _Tp,
int m,
int n>
class DataType<
Matx<_Tp, m, n> >
87 enum { generic_type = 0,
90 #ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
99 template<
typename _Tp,
int m,
int n>
101 template<
typename _Tp,
int m,
int n>
118 template<
typename _Tp,
typename _T2,
int m,
int n>
static inline
122 return (commaInitializer, val);
125 template<
typename _Tp,
int m,
int n>
inline
130 template<
typename _Tp,
int m,
int n>
template<
typename _T2>
inline
138 template<
typename _Tp,
int m,
int n>
inline
147 template<
typename _Tp,
int m,
int n>
inline
150 for(
int i = 0; i <
channels; i++) val[i] = _Tp(0);
153 template<
typename _Tp,
int m,
int n>
inline
157 for(
int i = 1; i <
channels; i++) val[i] = _Tp(0);
160 template<
typename _Tp,
int m,
int n>
inline
163 CV_StaticAssert(
channels >= 2,
"Matx should have at least 2 elements.");
164 val[0] = v0; val[1] = v1;
165 for(
int i = 2; i <
channels; i++) val[i] = _Tp(0);
168 template<
typename _Tp,
int m,
int n>
inline
171 CV_StaticAssert(
channels >= 3,
"Matx should have at least 3 elements.");
172 val[0] = v0; val[1] = v1; val[2] = v2;
173 for(
int i = 3; i <
channels; i++) val[i] = _Tp(0);
176 template<
typename _Tp,
int m,
int n>
inline
179 CV_StaticAssert(
channels >= 4,
"Matx should have at least 4 elements.");
180 val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;
184 template<
typename _Tp,
int m,
int n>
inline
187 CV_StaticAssert(
channels >= 5,
"Matx should have at least 5 elements.");
188 val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3; val[4] = v4;
189 for(
int i = 5; i <
channels; i++) val[i] = _Tp(0);
192 template<
typename _Tp,
int m,
int n>
inline
195 CV_StaticAssert(
channels >= 6,
"Matx should have at least 6 elements.");
196 val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;
197 val[4] = v4; val[5] = v5;
198 for(
int i = 6; i <
channels; i++) val[i] = _Tp(0);
201 template<
typename _Tp,
int m,
int n>
inline
204 CV_StaticAssert(
channels >= 7,
"Matx should have at least 7 elements.");
205 val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;
206 val[4] = v4; val[5] = v5; val[6] = v6;
210 template<
typename _Tp,
int m,
int n>
inline
213 CV_StaticAssert(
channels >= 8,
"Matx should have at least 8 elements.");
214 val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;
215 val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7;
219 template<
typename _Tp,
int m,
int n>
inline
220 Matx<_Tp, m, n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8)
222 CV_StaticAssert(
channels >= 9,
"Matx should have at least 9 elements.");
223 val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;
224 val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7;
226 for(
int i = 9; i <
channels; i++) val[i] = _Tp(0);
229 template<
typename _Tp,
int m,
int n>
inline
230 Matx<_Tp, m, n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9)
232 CV_StaticAssert(
channels >= 10,
"Matx should have at least 10 elements.");
233 val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;
234 val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7;
235 val[8] = v8; val[9] = v9;
236 for(
int i = 10; i <
channels; i++) val[i] = _Tp(0);
240 template<
typename _Tp,
int m,
int n>
inline
241 Matx<_Tp,m,n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9, _Tp v10, _Tp v11)
243 CV_StaticAssert(
channels >= 12,
"Matx should have at least 12 elements.");
244 val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;
245 val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7;
246 val[8] = v8; val[9] = v9; val[10] = v10; val[11] = v11;
247 for(
int i = 12; i <
channels; i++) val[i] = _Tp(0);
250 template<
typename _Tp,
int m,
int n>
inline
251 Matx<_Tp,m,n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9, _Tp v10, _Tp v11, _Tp v12, _Tp v13)
253 CV_StaticAssert(
channels >= 14,
"Matx should have at least 14 elements.");
254 val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;
255 val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7;
256 val[8] = v8; val[9] = v9; val[10] = v10; val[11] = v11;
257 val[12] = v12; val[13] = v13;
258 for (
int i = 14; i <
channels; i++) val[i] = _Tp(0);
262 template<
typename _Tp,
int m,
int n>
inline
263 Matx<_Tp,m,n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9, _Tp v10, _Tp v11, _Tp v12, _Tp v13, _Tp v14, _Tp v15)
265 CV_StaticAssert(
channels >= 16,
"Matx should have at least 16 elements.");
266 val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;
267 val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7;
268 val[8] = v8; val[9] = v9; val[10] = v10; val[11] = v11;
269 val[12] = v12; val[13] = v13; val[14] = v14; val[15] = v15;
270 for(
int i = 16; i <
channels; i++) val[i] = _Tp(0);
274 #if defined _MSC_VER && _MSC_VER >= 1920
275 #pragma warning(push)
276 #pragma warning(disable: 4702)
278 template<
typename _Tp,
int m,
int n>
inline
281 for(
int i = 0; i <
channels; i++ ) val[i] = values[i];
283 #if defined _MSC_VER && _MSC_VER >= 1920
287 template<
typename _Tp,
int m,
int n>
inline
292 for(
const auto&
elem : list)
298 template<
typename _Tp,
int m,
int n>
inline
302 for(
int i = 0; i < m*n; i++ )
M.val[i] =
alpha;
306 template<
typename _Tp,
int m,
int n>
inline
312 template<
typename _Tp,
int m,
int n>
inline
318 template<
typename _Tp,
int m,
int n>
inline
322 for(
int i = 0; i < shortdim; i++)
327 template<
typename _Tp,
int m,
int n>
inline
331 for(
int i = 0; i <
channels; i++ ) s += val[i]*
M.val[i];
335 template<
typename _Tp,
int m,
int n>
inline
339 for(
int i = 0; i <
channels; i++ ) s += (
double)val[i]*
M.val[i];
343 template<
typename _Tp,
int m,
int n>
inline
347 for(
int i = 0; i < shortdim; i++)
352 template<
typename _Tp,
int m,
int n>
template<
typename T2>
356 for(
int i = 0; i < m*n; i++ )
M.val[i] = saturate_cast<T2>(val[i]);
360 template<
typename _Tp,
int m,
int n>
template<
int m1,
int n1>
inline
363 CV_StaticAssert(m1*n1 == m*n,
"Input and destination matrices must have the same number of elements");
367 template<
typename _Tp,
int m,
int n>
368 template<
int m1,
int n1>
inline
371 CV_DbgAssert(0 <= base_row && base_row+m1 <= m && 0 <= base_col && base_col+n1 <= n);
373 for(
int di = 0; di < m1; di++ )
374 for(
int dj = 0; dj < n1; dj++ )
375 s(di, dj) = (*this)(base_row+di, base_col+dj);
379 template<
typename _Tp,
int m,
int n>
inline
386 template<
typename _Tp,
int m,
int n>
inline
391 for(
int i = 0; i < m; i++ )
396 template<
typename _Tp,
int m,
int n>
inline
400 for(
int i = 0; i < shortdim; i++ )
405 template<
typename _Tp,
int m,
int n>
inline
408 CV_DbgAssert( (
unsigned)row_idx < (
unsigned)m && (
unsigned)col_idx < (
unsigned)n );
409 return this->val[row_idx*n + col_idx];
412 template<
typename _Tp,
int m,
int n>
inline
415 CV_DbgAssert( (
unsigned)row_idx < (
unsigned)m && (
unsigned)col_idx < (
unsigned)n );
416 return val[row_idx*n + col_idx];
419 template<
typename _Tp,
int m,
int n>
inline
422 CV_StaticAssert(m == 1 || n == 1,
"Single index indexation requires matrix to be a column or a row");
427 template<
typename _Tp,
int m,
int n>
inline
430 CV_StaticAssert(m == 1 || n == 1,
"Single index indexation requires matrix to be a column or a row");
435 template<
typename _Tp,
int m,
int n>
inline
439 val[i] = saturate_cast<_Tp>(a.
val[i] + b.
val[i]);
442 template<
typename _Tp,
int m,
int n>
inline
446 val[i] = saturate_cast<_Tp>(a.
val[i] - b.
val[i]);
449 template<
typename _Tp,
int m,
int n>
template<
typename _T2>
inline
453 val[i] = saturate_cast<_Tp>(a.
val[i] *
alpha);
456 template<
typename _Tp,
int m,
int n>
inline
460 val[i] = saturate_cast<_Tp>(a.
val[i] * b.
val[i]);
463 template<
typename _Tp,
int m,
int n>
inline
467 val[i] = saturate_cast<_Tp>(a.
val[i] / b.
val[i]);
470 template<
typename _Tp,
int m,
int n>
template<
int l>
inline
473 for(
int i = 0; i < m; i++ )
474 for(
int j = 0; j < n; j++ )
477 for(
int k = 0;
k < l;
k++ )
478 s += a(i,
k) * b(
k, j);
483 template<
typename _Tp,
int m,
int n>
inline
486 for(
int i = 0; i < m; i++ )
487 for(
int j = 0; j < n; j++ )
488 val[i*n + j] = a(j, i);
491 template<
typename _Tp,
int m,
int n>
inline
497 template<
typename _Tp,
int m,
int n>
inline
503 template<
typename _Tp,
int m,
int n>
inline
509 template<
typename _Tp,
int m,
int n>
inline
516 template<
typename _Tp,
int m>
static inline
522 template<
typename _Tp,
int m,
int n>
static inline
526 for(
int i = 0; i <
std::min(m, n); i++ )
531 template<
typename _Tp,
int m,
int n>
static inline
534 return std::sqrt(normL2Sqr<_Tp, double>(
M.val, m*n));
537 template<
typename _Tp,
int m,
int n>
static inline
542 return (
double)normInf<_Tp, typename DataType<_Tp>::work_type>(
M.val, m*n);
544 return (
double)normL1<_Tp, typename DataType<_Tp>::work_type>(
M.val, m*n);
546 return (
double)normL2Sqr<_Tp, typename DataType<_Tp>::work_type>(
M.val, m*n);
553 template<
typename _Tp1,
typename _Tp2,
int m,
int n>
static inline
556 for(
int i = 0; i < m*n; i++ )
557 a.
val[i] = saturate_cast<_Tp1>(a.
val[i] + b.
val[i]);
561 template<
typename _Tp1,
typename _Tp2,
int m,
int n>
static inline
564 for(
int i = 0; i < m*n; i++ )
565 a.
val[i] = saturate_cast<_Tp1>(a.
val[i] - b.
val[i]);
569 template<
typename _Tp,
int m,
int n>
static inline
575 template<
typename _Tp,
int m,
int n>
static inline
581 template<
typename _Tp,
int m,
int n>
static inline
584 for(
int i = 0; i < m*n; i++ )
589 template<
typename _Tp,
int m,
int n>
static inline
592 for(
int i = 0; i < m*n; i++ )
597 template<
typename _Tp,
int m,
int n>
static inline
600 for(
int i = 0; i < m*n; i++ )
605 template<
typename _Tp,
int m,
int n>
static inline
611 template<
typename _Tp,
int m,
int n>
static inline
617 template<
typename _Tp,
int m,
int n>
static inline
623 template<
typename _Tp,
int m,
int n>
static inline
629 template<
typename _Tp,
int m,
int n>
static inline
635 template<
typename _Tp,
int m,
int n>
static inline
641 template<
typename _Tp,
int m,
int n>
static inline
644 for(
int i = 0; i < m*n; i++ )
649 template<
typename _Tp,
int m,
int n>
static inline
652 for(
int i = 0; i < m*n; i++ )
657 template<
typename _Tp,
int m,
int n>
static inline
663 template<
typename _Tp,
int m,
int n>
static inline
669 template<
typename _Tp,
int m,
int n>
static inline
675 template<
typename _Tp,
int m,
int n,
int l>
static inline
681 template<
typename _Tp,
int m,
int n>
static inline
688 template<
typename _Tp,
int m,
int n>
static inline
691 for(
int i = 0; i < m*n; i++ )
692 if( a.
val[i] != b.
val[i] )
return false;
696 template<
typename _Tp,
int m,
int n>
static inline
713 enum { generic_type = 0,
716 #ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
720 _dummy_enum_finalizer = 0
725 template<
typename _Tp,
int cn>
727 template<
typename _Tp,
int cn>
741 template<
typename _Tp,
typename _T2,
int cn>
static inline
745 return (commaInitializer, val);
748 template<
typename _Tp,
int cn>
inline
753 template<
typename _Tp,
int cn>
template<
typename _T2>
inline
757 this->
dst->val[this->
idx++] = saturate_cast<_Tp>(
value);
761 template<
typename _Tp,
int cn>
inline
769 template<
typename _Tp,
int cn>
inline
772 template<
typename _Tp,
int cn>
inline
774 :
Matx<_Tp, cn, 1>(v0) {}
776 template<
typename _Tp,
int cn>
inline
778 :
Matx<_Tp, cn, 1>(v0, v1) {}
780 template<
typename _Tp,
int cn>
inline
782 :
Matx<_Tp, cn, 1>(v0, v1, v2) {}
784 template<
typename _Tp,
int cn>
inline
786 :
Matx<_Tp, cn, 1>(v0, v1, v2, v3) {}
788 template<
typename _Tp,
int cn>
inline
790 :
Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4) {}
792 template<
typename _Tp,
int cn>
inline
794 :
Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5) {}
796 template<
typename _Tp,
int cn>
inline
798 :
Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5, v6) {}
800 template<
typename _Tp,
int cn>
inline
802 :
Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5, v6, v7) {}
804 template<
typename _Tp,
int cn>
inline
806 :
Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5, v6, v7, v8) {}
808 template<
typename _Tp,
int cn>
inline
809 Vec<_Tp, cn>::Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9)
810 :
Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {}
812 template<
typename _Tp,
int cn>
inline
813 Vec<_Tp, cn>::Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9, _Tp v10, _Tp v11, _Tp v12, _Tp v13)
814 :
Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) {}
816 template<
typename _Tp,
int cn>
inline
818 :
Matx<_Tp, cn, 1>(values) {}
820 template<
typename _Tp,
int cn>
inline
822 :
Matx<_Tp, cn, 1>(list) {}
824 template<
typename _Tp,
int cn>
inline
826 :
Matx<_Tp, cn, 1>(m.val) {}
828 template<
typename _Tp,
int cn>
inline
830 :
Matx<_Tp, cn, 1>(a, b, op) {}
832 template<
typename _Tp,
int cn>
inline
834 :
Matx<_Tp, cn, 1>(a, b, op) {}
836 template<
typename _Tp,
int cn>
template<
typename _T2>
inline
840 template<
typename _Tp,
int cn>
inline
844 for(
int i = 0; i < cn; i++ ) v.
val[i] =
alpha;
848 template<
typename _Tp,
int cn>
inline
854 template<
typename _Tp,
int cn>
inline
860 template<
typename _Tp,
int cn>
inline
864 for(
int i = 0; i < cn; i++ ) w.
val[i] = saturate_cast<_Tp>(this->val[i]*v.
val[i]);
892 template<
typename _Tp,
int cn>
inline
895 CV_StaticAssert(cn == 3,
"for arbitrary-size vector there is no cross-product defined");
903 this->val[2]*v.
val[0] - this->val[0]*v.
val[2],
904 this->val[0]*v.
val[1] - this->val[1]*v.
val[0]);
911 this->val[2]*v.
val[0] - this->val[0]*v.
val[2],
912 this->val[0]*v.
val[1] - this->val[1]*v.
val[0]);
915 template<
typename _Tp,
int cn>
template<
typename T2>
inline
919 for(
int i = 0; i < cn; i++ ) v.
val[i] = saturate_cast<T2>(this->val[i]);
923 template<
typename _Tp,
int cn>
inline
930 template<
typename _Tp,
int cn>
inline
937 template<
typename _Tp,
int cn>
inline
944 template<
typename _Tp,
int cn>
inline
951 template<
typename _Tp,
int cn>
inline
955 return v * (nv ? 1./nv : 0.);
958 template<
typename _Tp1,
typename _Tp2,
int cn>
static inline
961 for(
int i = 0; i < cn; i++ )
962 a.
val[i] = saturate_cast<_Tp1>(a.
val[i] + b.
val[i]);
966 template<
typename _Tp1,
typename _Tp2,
int cn>
static inline
969 for(
int i = 0; i < cn; i++ )
970 a.
val[i] = saturate_cast<_Tp1>(a.
val[i] - b.
val[i]);
974 template<
typename _Tp,
int cn>
static inline
980 template<
typename _Tp,
int cn>
static inline
986 template<
typename _Tp,
int cn>
static inline
989 for(
int i = 0; i < cn; i++ )
990 a[i] = saturate_cast<_Tp>(a[i]*
alpha);
994 template<
typename _Tp,
int cn>
static inline
997 for(
int i = 0; i < cn; i++ )
998 a[i] = saturate_cast<_Tp>(a[i]*
alpha);
1002 template<
typename _Tp,
int cn>
static inline
1005 for(
int i = 0; i < cn; i++ )
1006 a[i] = saturate_cast<_Tp>(a[i]*
alpha);
1010 template<
typename _Tp,
int cn>
static inline
1013 double ialpha = 1./
alpha;
1014 for(
int i = 0; i < cn; i++ )
1015 a[i] = saturate_cast<_Tp>(a[i]*ialpha);
1019 template<
typename _Tp,
int cn>
static inline
1022 float ialpha = 1.f/
alpha;
1023 for(
int i = 0; i < cn; i++ )
1024 a[i] = saturate_cast<_Tp>(a[i]*ialpha);
1028 template<
typename _Tp,
int cn>
static inline
1031 double ialpha = 1./
alpha;
1032 for(
int i = 0; i < cn; i++ )
1033 a[i] = saturate_cast<_Tp>(a[i]*ialpha);
1037 template<
typename _Tp,
int cn>
static inline
1043 template<
typename _Tp,
int cn>
static inline
1049 template<
typename _Tp,
int cn>
static inline
1055 template<
typename _Tp,
int cn>
static inline
1061 template<
typename _Tp,
int cn>
static inline
1067 template<
typename _Tp,
int cn>
static inline
1073 template<
typename _Tp,
int cn>
static inline
1079 template<
typename _Tp,
int cn>
static inline
1085 template<
typename _Tp,
int cn>
static inline
1091 template<
typename _Tp,
int cn>
static inline
1095 for(
int i = 0; i < cn; i++ ) t.
val[i] = saturate_cast<_Tp>(-a.
val[i]);
1101 return Vec<_Tp, 4>(saturate_cast<_Tp>(v1[0]*v2[0] - v1[1]*v2[1] - v1[2]*v2[2] - v1[3]*v2[3]),
1102 saturate_cast<_Tp>(v1[0]*v2[1] + v1[1]*v2[0] + v1[2]*v2[3] - v1[3]*v2[2]),
1103 saturate_cast<_Tp>(v1[0]*v2[2] - v1[1]*v2[3] + v1[2]*v2[0] + v1[3]*v2[1]),
1104 saturate_cast<_Tp>(v1[0]*v2[3] + v1[1]*v2[2] - v1[2]*v2[1] + v1[3]*v2[0]));
_Tp channel_type
Definition: matx.inl.hpp:84
Matx< typename DataType< _Tp >::work_type, m, n > work_type
Definition: matx.inl.hpp:83
value_type vec_type
Definition: matx.inl.hpp:85
Matx< _Tp, m, n > value_type
Definition: matx.inl.hpp:82
_Tp channel_type
Definition: matx.inl.hpp:710
Vec< typename DataType< _Tp >::work_type, cn > work_type
Definition: matx.inl.hpp:709
Vec< _Tp, cn > value_type
Definition: matx.inl.hpp:708
value_type vec_type
Definition: matx.inl.hpp:711
Template "trait" class for OpenCV primitive data types.
Definition: traits.hpp:113
Comma-separated Matrix Initializer.
Definition: matx.inl.hpp:108
int idx
Definition: matx.inl.hpp:115
Matx< _Tp, m, n > * dst
Definition: matx.inl.hpp:114
MatxCommaInitializer< _Tp, m, n > & operator,(T2 val)
Matx< _Tp, m, n > operator*() const
Definition: matx.inl.hpp:139
MatxCommaInitializer(Matx< _Tp, m, n > *_mtx)
Definition: matx.inl.hpp:126
Template class for small matrices whose type and size are known at compilation time.
Definition: matx.hpp:100
Matx< _Tp, m, n > mul(const Matx< _Tp, m, n > &a) const
multiply two matrices element-wise
Definition: matx.inl.hpp:492
Matx()
default constructor
Definition: matx.inl.hpp:148
Matx< _Tp, n, m > t() const
transpose the matrix
Definition: matx.inl.hpp:504
static CV_NODISCARD_STD Matx ones()
Definition: matx.inl.hpp:313
Matx< _Tp, 1, n > row(int i) const
extract the matrix row
Definition: matx.inl.hpp:380
Matx< _Tp, m, 1 > col(int i) const
extract the matrix column
Definition: matx.inl.hpp:387
static CV_NODISCARD_STD Matx eye()
Definition: matx.inl.hpp:319
Matx< _Tp, n, l > solve(const Matx< _Tp, m, l > &rhs, int flags=DECOMP_LU) const
solve linear system
Matx< _Tp, m, n > div(const Matx< _Tp, m, n > &a) const
divide two matrices element-wise
Definition: matx.inl.hpp:498
Matx< _Tp, m1, n1 > reshape() const
change the matrix shape
Definition: matx.inl.hpp:361
static CV_NODISCARD_STD Matx zeros()
Definition: matx.inl.hpp:307
const _Tp & operator()(int row, int col) const
element access
Definition: matx.inl.hpp:406
static CV_NODISCARD_STD Matx all(_Tp alpha)
Definition: matx.inl.hpp:299
double ddot(const Matx< _Tp, m, n > &v) const
dot product computed in double-precision arithmetics
Definition: matx.inl.hpp:336
diag_type diag() const
extract the matrix diagonal
Definition: matx.inl.hpp:397
_Tp val[m *n]
matrix elements
Definition: matx.hpp:218
Matx< _Tp, m1, n1 > get_minor(int base_row, int base_col) const
extract part of the matrix
Definition: matx.inl.hpp:369
_Tp dot(const Matx< _Tp, m, n > &v) const
dot product computed with the default precision
Definition: matx.inl.hpp:328
Comma-separated Vec Initializer.
Definition: matx.inl.hpp:734
Vec< _Tp, m > operator*() const
Definition: matx.inl.hpp:762
VecCommaInitializer(Vec< _Tp, m > *_vec)
Definition: matx.inl.hpp:749
VecCommaInitializer< _Tp, m > & operator,(T2 val)
Template class for short numerical vectors, a partial case of Matx.
Definition: matx.hpp:369
static Vec zeros()
Definition: matx.inl.hpp:855
static Vec all(_Tp alpha)
Definition: matx.inl.hpp:841
Vec mul(const Vec< _Tp, cn > &v) const
per-element multiplication
Definition: matx.inl.hpp:861
Vec()
default constructor
Definition: matx.inl.hpp:770
const _Tp & operator[](int i) const
Definition: matx.inl.hpp:924
Vec cross(const Vec &v) const
Definition: matx.inl.hpp:893
static Vec ones()
Definition: matx.inl.hpp:849
const _Tp & operator()(int i) const
Definition: matx.inl.hpp:938
Vec conj() const
conjugation (makes sense for complex numbers and quaternions)
CV_EXPORTS_W bool solve(InputArray src1, InputArray src2, OutputArray dst, int flags=DECOMP_LU)
Solves one or more linear systems or least-squares problems.
@ NORM_L2
Definition: base.hpp:185
@ NORM_L1
Definition: base.hpp:176
@ NORM_L2SQR
Definition: base.hpp:194
@ NORM_INF
Definition: base.hpp:168
static double determinant(const Matx< _Tp, m, m > &a)
Vec< _Tp, cn > normalize(const Vec< _Tp, cn > &v)
Definition: matx.inl.hpp:952
static double trace(const Matx< _Tp, m, n > &a)
static bool operator!=(const Matx< _Tp, m, n > &a, const Matx< _Tp, m, n > &b)
static double norm(const Matx< _Tp, m, n > &M)
static bool operator==(const Matx< _Tp, m, n > &a, const Matx< _Tp, m, n > &b)
int CvScalar value
Definition: core_c.h:720
int int channels
Definition: core_c.h:100
const void * elem
Definition: core_c.h:1715
const int * idx
Definition: core_c.h:668
int int type
Definition: core_c.h:221
int depth
Definition: core_c.h:100
const CvArr CvArr * x
Definition: core_c.h:1195
double alpha
Definition: core_c.h:1093
#define CV_MAKETYPE(depth, cn)
Definition: interface.h:85
CV_INLINE v_reg< _Tp, n > & operator-=(v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
CV_INLINE v_reg< _Tp, n > & operator*=(v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
CV_INLINE v_reg< _Tp, n > & operator/=(v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
CV_INLINE v_reg< _Tp, n > operator/(const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Divide values.
CV_INLINE v_reg< _Tp, n > & operator+=(v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
CV_EXPORTS int LU(float *A, size_t astep, int m, float *b, size_t bstep, int n)
static _AccTp normL2Sqr(const _Tp *a, int n)
Definition: base.hpp:404
#define CV_DbgAssert(expr)
Definition: base.hpp:375
std::ostream & operator<<(std::ostream &, const DualQuat< _Tp > &)
CvArr CvPoint2D32f double M
Definition: imgproc_c.h:270
const CvArr CvArr int method
Definition: imgproc_c.h:384
CvArr CvArr * temp
Definition: imgproc_c.h:329
CV_EXPORTS OutputArray int double double InputArray OutputArray int int bool double k
Definition: imgproc.hpp:2133
OutputArray dst
Definition: imgproc.hpp:3564
Vec< _Tp, 2 > conjugate(const Vec< _Tp, 2 > &v)
Definition: matx.inl.hpp:63
"black box" representation of the file storage associated with a file on disk.
Definition: calib3d.hpp:441
DualQuat< T > operator+(const T a, const DualQuat< T > &q)
Definition: dualquaternion.inl.hpp:243
DualQuat< T > operator*(const T a, const DualQuat< T > &q)
Definition: dualquaternion.inl.hpp:274
DualQuat< T > operator-(const DualQuat< T > &q, const T a)
Definition: dualquaternion.inl.hpp:255
Definition: matx.inl.hpp:24
double operator()(const Matx< _Tp, m, m > &a) const
Definition: matx.inl.hpp:25
Definition: traits.hpp:382
@ value
Definition: traits.hpp:382
Definition: traits.hpp:402
Definition: traits.hpp:386
@ value
Definition: traits.hpp:386