refactored downhill simplex implementation a bit; hopefully, fixed the bug with random failures in the tests

This commit is contained in:
Vadim Pisarevsky
2015-05-03 02:29:15 +03:00
parent a33d7928a4
commit 01e351de37
2 changed files with 257 additions and 248 deletions

View File

@@ -1475,13 +1475,15 @@ Mat_<_Tp> Mat_<_Tp>::operator()( const Range* ranges ) const
template<typename _Tp> inline
_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
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