49 #include <visp/vpMatrix.h>
50 #include <visp/vpMatrixException.h>
51 #include <visp/vpRowVector.h>
52 #include <visp/vpColVector.h>
53 #include <visp/vpDebug.h>
62 for (
unsigned int i=0; i<
rowNum; i++) {
63 for (
unsigned int j=0; j<
colNum; j++) {
92 for (
unsigned int i=0; i<
rowNum; i++) {
93 for (
unsigned int j=0; j<
colNum; j++) {
116 unsigned int nelements = x.
getRows();
119 "Bad size during vpRowVector (1x%d) by vpColVector (%dx1) multiplication",
125 for (
unsigned int i=0; i<nelements; i++) {
126 scalar += (*this)[i] * x[i];
151 vpERROR_TRACE(
"vpMatrix mismatch in vpRowVector/matrix multiply") ;
153 "vpMatrix mismatch in vpRowVector/matrix multiply")) ;
158 for (
unsigned int i=0;i<
colNum;i++) {
160 double bi =
data[i] ;
161 for (
unsigned int j=0;j<A.
getCols();j++) {
183 double *vd = A.
data ;
double *d =
data ;
185 for (
unsigned int i=0; i<
colNum; i++)
196 "Bad size during vpRowVector (1x%d) and vpRowVector (1x%d) substraction",
202 for (
unsigned int i=0;i<
colNum;i++)
203 v[i] = (*
this)[i] - m[i];
212 "Bad size during vpRowVector (1x%d) and vpRowVector (1x%d) substraction",
218 for (
unsigned int i=0;i<
colNum;i++)
219 v[i] = (*
this)[i] + m[i];
306 *
this /= sum_square ;
330 if(
dsize!=nrows*ncols)
332 vpERROR_TRACE(
"\n\t\t vpSubRowVector mismatch size for reshape vpSubColVector in a vpMatrix") ;
334 "\n\t\t \n\t\t vpSubRowVector mismatch size for reshape vpSubColVector in a vpMatrix")) ;
343 std::cout << me << std::endl ;
346 for(
unsigned int i =0; i< nrows; i++)
347 for(
unsigned int j =0; j< ncols; j++)
348 m[i][j]=
data[i*nrows+j];
390 for (
unsigned int j=0; j < v.
size(); j++)
Definition of the vpMatrix class.
void resize(const unsigned int nrows, const unsigned int ncols, const bool nullify=true)
Definition of the row vector class.
vpRowVector & normalize()
Normalise the vector.
error that can be emited by ViSP classes.
vpRowVector operator+(const vpRowVector &v) const
Addition of two vectors V = A+v.
unsigned int size() const
double * data
address of the first element of the data array
double ** rowPtrs
address of the first element of each rows
vpColVector t() const
Transpose the vector.
double operator*(const vpColVector &x) const
operator dot product
vpRowVector operator-() const
Operator A = -A.
void resize(const unsigned int i, const bool flagNullify=true)
unsigned int rowNum
number of rows
vpRowVector & operator<<(const vpRowVector &v)
Class that provides a data structure for the column vectors as well as a set of operations on these v...
void reshape(vpMatrix &m, const unsigned int &nrows, const unsigned int &ncols)
Reshape methods.
unsigned int getCols() const
Return the number of columns of the matrix.
error that can be emited by the vpMatrix class and its derivates
vpRowVector & operator=(const vpRowVector &v)
Copy operator. Allow operation such as A = v.
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.
vpRowVector()
Basic constructor.
void insert(unsigned int i, const vpRowVector &v)