Commit 01e351de authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

refactored downhill simplex implementation a bit; hopefully, fixed the bug with…

refactored downhill simplex implementation a bit; hopefully, fixed the bug with random failures in the tests
parent a33d7928
...@@ -1475,13 +1475,15 @@ Mat_<_Tp> Mat_<_Tp>::operator()( const Range* ranges ) const ...@@ -1475,13 +1475,15 @@ Mat_<_Tp> Mat_<_Tp>::operator()( const Range* ranges ) const
template<typename _Tp> inline template<typename _Tp> inline
_Tp* Mat_<_Tp>::operator [](int y) _Tp* Mat_<_Tp>::operator [](int y)
{ {
return (_Tp*)ptr(y); CV_DbgAssert( 0 <= y && y < rows );
return (_Tp*)(data + y*step.p[0]);
} }
template<typename _Tp> inline template<typename _Tp> inline
const _Tp* Mat_<_Tp>::operator [](int y) const const _Tp* Mat_<_Tp>::operator [](int y) const
{ {
return (const _Tp*)ptr(y); CV_DbgAssert( 0 <= y && y < rows );
return (const _Tp*)(data + y*step.p[0]);
} }
template<typename _Tp> inline template<typename _Tp> inline
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment