Merge pull request #13928 from catree:add_matx_div_operations
This commit is contained in:
@@ -1279,6 +1279,34 @@ Matx<_Tp, m, n> operator * (double alpha, const Matx<_Tp, m, n>& a)
|
||||
return Matx<_Tp, m, n>(a, alpha, Matx_ScaleOp());
|
||||
}
|
||||
|
||||
template<typename _Tp, int m, int n> static inline
|
||||
Matx<_Tp, m, n>& operator /= (Matx<_Tp, m, n>& a, float alpha)
|
||||
{
|
||||
for( int i = 0; i < m*n; i++ )
|
||||
a.val[i] = a.val[i] / alpha;
|
||||
return a;
|
||||
}
|
||||
|
||||
template<typename _Tp, int m, int n> static inline
|
||||
Matx<_Tp, m, n>& operator /= (Matx<_Tp, m, n>& a, double alpha)
|
||||
{
|
||||
for( int i = 0; i < m*n; i++ )
|
||||
a.val[i] = a.val[i] / alpha;
|
||||
return a;
|
||||
}
|
||||
|
||||
template<typename _Tp, int m, int n> static inline
|
||||
Matx<_Tp, m, n> operator / (const Matx<_Tp, m, n>& a, float alpha)
|
||||
{
|
||||
return Matx<_Tp, m, n>(a, 1.f/alpha, Matx_ScaleOp());
|
||||
}
|
||||
|
||||
template<typename _Tp, int m, int n> static inline
|
||||
Matx<_Tp, m, n> operator / (const Matx<_Tp, m, n>& a, double alpha)
|
||||
{
|
||||
return Matx<_Tp, m, n>(a, 1./alpha, Matx_ScaleOp());
|
||||
}
|
||||
|
||||
template<typename _Tp, int m, int n> static inline
|
||||
Matx<_Tp, m, n> operator - (const Matx<_Tp, m, n>& a)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user