40 #include <visp3/core/vpDebug.h>
41 #include <visp3/core/vpException.h>
42 #include <visp3/core/vpMatrixException.h>
43 #include <visp3/core/vpSubMatrix.h>
56 const unsigned int &nrows,
const unsigned int &ncols)
57 : pRowNum(0), pColNum(0), parent(nullptr)
59 init(m, row_offset, col_offset, nrows, ncols);
71 const unsigned int &nrows,
const unsigned int &ncols)
78 if (((row_offset + nrows) <= m.
getRows()) && ((col_offset + ncols) <= m.
getCols())) {
90 rowPtrs = (
double **)malloc(nrows *
sizeof(
double *));
91 for (
unsigned int r = 0; r < nrows; ++r) {
111 "vpSubMatrix parent vpMatrix has been destroyed"));
115 "vpSubMatrix size of parent vpMatrix has been changed"));
128 "vpSubMatrix mismatch in operator vpSubMatrix=vpMatrix"));
131 for (
unsigned int i = 0; i <
rowNum; ++i) {
132 for (
unsigned int j = 0; j <
colNum; ++j) {
149 "vpSubMatrix mismatch in operator vpSubMatrix=vpMatrix"));
158 for (
unsigned int i = 0; i <
rowNum; ++i) {
159 for (
unsigned int j = 0; j <
colNum; ++j) {
160 rowPtrs[i][j] = BrowPtrs[i][j];
173 for (
unsigned int i = 0; i <
rowNum; ++i) {
174 for (
unsigned int j = 0; j <
colNum; ++j) {
unsigned int getCols() const
Type * data
Address of the first element of the data array.
double ** rowPtrs
Address of the first element of each rows.
unsigned int rowNum
Number of rows in the array.
unsigned int dsize
Current array size (rowNum * colNum)
unsigned int getRows() const
unsigned int colNum
Number of columns in the array.
error that can be emitted by the vpMatrix class and its derivatives
@ incorrectMatrixSizeError
Incorrect matrix size.
@ subMatrixError
Sub operation matrix error.
Implementation of a matrix and operations on matrices.
vp_deprecated void init()
Definition of the vpSubMatrix class that provides a mask on a vpMatrix. All properties of vpMatrix ar...
void checkParentStatus() const
Check is parent vpRowVector has changed since initialization.
virtual ~vpSubMatrix() vp_override
Destructor.
vpSubMatrix()
Default constructor.
vpSubMatrix & operator=(const vpSubMatrix &B)
Operation such as subA = subB.