43 #include <visp/vpSubMatrix.h>
44 #include <visp/vpException.h>
45 #include <visp/vpMatrixException.h>
46 #include <visp/vpDebug.h>
70 init(m,row,col,nrows,ncols);
81 void vpSubMatrix::init(
vpMatrix &m,
const unsigned int & row,
const unsigned int &col ,
const unsigned int & nrows ,
const unsigned int & ncols){
84 vpERROR_TRACE(
"\n\t\t SubMatrix parent matrix is not allocated") ;
86 "\n\t\t SubMatrix parent matrix is not allocated")) ;
100 rowPtrs=(
double**) malloc(nrows *
sizeof(
double*));
101 for(
unsigned int r=0;r<nrows;r++)
107 vpERROR_TRACE(
"Submatrix cannot be contain in parent matrix") ;
118 vpERROR_TRACE(
"\n\t\t vpSubMatrix parent vpMatrix has been destroyed");
120 "\n\t\t \n\t\t vpSubMatrix parent vpMatrix has been destroyed")) ;
123 vpERROR_TRACE(
"\n\t\t vpSubMatrix size of parent vpMatrix has been changed");
125 "\n\t\t \n\t\t vpSubMatrix size of parent vpMatrix has been changed")) ;
137 vpERROR_TRACE(
"\n\t\t vpSubMatrix mismatch in operator vpSubMatrix=vpMatrix") ;
139 "\n\t\t \n\t\t vpSubMatrix mismatch in operator vpSubMatrix=vpMatrix")) ;
142 for (
unsigned int i=0;i<
rowNum;i++)
143 for(
unsigned int j=0;j<
colNum;j++)
157 vpERROR_TRACE(
"\n\t\t vpSubMatrix mismatch in operator vpSubMatrix=vpMatrix") ;
159 "\n\t\t \n\t\t vpSubMatrix mismatch in operator vpSubMatrix=vpMatrix")) ;
165 for (
unsigned int i=0;i<
rowNum;i++)
166 for(
unsigned int j=0;j<
colNum;j++)
167 rowPtrs[i][j] = BrowPtrs[i][j];
177 for (
unsigned int i=0;i<
rowNum;i++)
178 for(
unsigned int j=0;j<
colNum;j++)
Definition of the vpMatrix class.
void checkParentStatus()
Check is parent vpRowVector has changed since initialization.
void init()
Initialization of the object matrix.
Definition of the vpSubMatrix vpSubMatrix class provides a mask on a vpMatrix all properties of vpMat...
double * data
address of the first element of the data array
unsigned int trsize
Total row space.
double ** rowPtrs
address of the first element of each rows
~vpSubMatrix()
Destructor.
unsigned int rowNum
number of rows
unsigned int getCols() const
Return the number of columns of the matrix.
vpSubMatrix & operator=(const vpSubMatrix &B)
Operation such as subA = subB.
error that can be emited by the vpMatrix class and its derivates
unsigned int dsize
Current size (rowNum * colNum)
unsigned int colNum
number of columns
unsigned int getRows() const
Return the number of rows of the matrix.
vpSubMatrix()
Default constructor.