From 6309e821f0f9e55e4166b9121ef6f12c0b9daec5 Mon Sep 17 00:00:00 2001 From: Davis King Date: Sat, 31 Jan 2009 20:37:05 +0000 Subject: [PATCH] Fixed some errors in the requirements for calling the new rowm() and colm() functions. --HG-- extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402844 --- dlib/matrix/matrix_subexp.h | 4 ++-- dlib/matrix/matrix_subexp_abstract.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) 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