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++)