diff --git a/dlib/matrix/matrix_subexp.h b/dlib/matrix/matrix_subexp.h index 3f246dcd2..0b68ee772 100644 --- a/dlib/matrix/matrix_subexp.h +++ b/dlib/matrix/matrix_subexp.h @@ -235,7 +235,7 @@ namespace dlib ) { DLIB_ASSERT(row >= 0 && row < m.nr() && - length >= 0 && length < m.nc(), + length >= 0 && length <= m.nc(), "\tconst matrix_exp rowm(const matrix_exp& m, row, length)" << "\n\tYou have specified invalid sub matrix dimensions" << "\n\tm.nr(): " << m.nr() @@ -375,7 +375,7 @@ namespace dlib ) { DLIB_ASSERT(col >= 0 && col < m.nc() && - length >= 0 && length < m.nr(), + length >= 0 && length <= m.nr(), "\tconst matrix_exp colm(const matrix_exp& m, col, length)" << "\n\tYou have specified invalid sub matrix dimensions" << "\n\tm.nr(): " << m.nr() diff --git a/dlib/matrix/matrix_subexp_abstract.h b/dlib/matrix/matrix_subexp_abstract.h index dfb253126..f86f6c334 100644 --- a/dlib/matrix/matrix_subexp_abstract.h +++ b/dlib/matrix/matrix_subexp_abstract.h @@ -160,7 +160,7 @@ namespace dlib /*! requires - 0 <= row < m.nr() - - 0 <= length < m.nc() + - 0 <= length <= m.nc() ensures - returns a matrix R such that: - R.nr() == 1 @@ -198,7 +198,7 @@ namespace dlib ); /*! requires - - 0 <= col < m.nr() + - 0 <= col < m.nc() ensures - returns a matrix R such that: - R.nr() == m.nr() @@ -216,8 +216,8 @@ namespace dlib ); /*! requires - - 0 <= col < m.nr() - - 0 <= length < m.nc() + - 0 <= col < m.nc() + - 0 <= length <= m.nr() ensures - returns a matrix R such that: - R.nr() == length