47 #include <visp/vpConfig.h>
48 #include <visp/vpTime.h>
51 # include <gsl/gsl_math.h>
52 # include <gsl/gsl_eigen.h>
130 vpMatrix(
unsigned int r,
unsigned int c) ;
134 unsigned int nrows,
unsigned int ncols) ;
146 void eye(
unsigned int n) ;
148 void eye(
unsigned int m,
unsigned int n) ;
149 void setIdentity(
const double & val=1.0) ;
156 inline unsigned int getRows()
const {
return rowNum ;}
159 inline unsigned int getCols()
const {
return colNum; }
162 void resize(
const unsigned int nrows,
const unsigned int ncols,
163 const bool nullify =
true);
165 double getMinValue()
const;
167 double getMaxValue()
const;
174 friend VISP_EXPORT std::ostream &operator << (std::ostream &s,
const vpMatrix &m);
178 int print(std::ostream& s,
unsigned int length,
char const* intro=0);
179 std::ostream & matlabPrint(std::ostream & os);
180 std::ostream & cppPrint(std::ostream & os,
const char * matrixName = NULL,
bool octet =
false);
182 void printSize() { std::cout << getRows() <<
" x " << getCols() <<
" " ; }
185 static bool saveMatrix(
const char *filename,
const vpMatrix &M,
const bool binary =
false,
const char *Header =
"");
186 static bool loadMatrix(
const char *filename,
vpMatrix &M,
const bool binary =
false,
char *Header = NULL);
201 const bool binary =
false,
202 const char *Header =
"")
218 const bool binary =
false,
char *Header = NULL)
237 vpMatrix &operator=(
const double x);
246 inline double *operator[](
unsigned int n) {
return rowPtrs[n]; }
249 inline double *
operator[](
unsigned int n)
const {
return rowPtrs[n];}
258 static void add2WeightedMatrices(
const vpMatrix &A,
const double &wA,
const vpMatrix &B,
const double &wB,
vpMatrix &C);
293 vpMatrix &operator+=(
const double x);
295 vpMatrix &operator-=(
const double x);
297 vpMatrix &operator*=(
const double x);
302 vpMatrix operator*(
const double x)
const;
304 vpMatrix operator/(
const double x)
const;
307 double sumSquare()
const;
310 double det(vpDetMethod method = LU_DECOMPOSITION)
const;
325 void init(
const vpMatrix &m,
unsigned int r,
unsigned int c,
326 unsigned int nrows,
unsigned int ncols);
386 #ifndef DOXYGEN_SHOULD_SKIP_THIS
387 void LUDcmp(
unsigned int* perm,
int& d);
391 #endif // doxygen should skip this
401 #ifndef DOXYGEN_SHOULD_SKIP_THIS
407 #if (VISP_HAVE_OPENCV_VERSION >= 0x020100) // Require opencv >= 2.1.0
410 #ifdef VISP_HAVE_LAPACK
431 vpMatrix pseudoInverse(
double svThreshold=1e-6)
const;
434 unsigned int pseudoInverse(
vpMatrix &Ap,
double svThreshold=1e-6)
const;
440 unsigned int pseudoInverse(
vpMatrix &Ap,
446 unsigned int pseudoInverse(
vpMatrix &Ap,
452 unsigned int kernel(
vpMatrix &KerA,
double svThreshold=1e-6);
480 void stackMatrices(
const vpMatrix &A);
483 void insert(
const vpMatrix&A,
const unsigned int r,
const unsigned int c);
495 double euclideanNorm ()
const;
497 double infinityNorm ()
const;
501 double detByLU()
const;
Definition of the vpMatrix class.
static bool loadMatrix(std::string filename, vpMatrix &M, const bool binary=false, char *Header=NULL)
Definition of the row vector class.
static bool saveMatrix(const char *filename, const vpMatrix &M, const bool binary=false, const char *Header="")
VISP_EXPORT vpImagePoint operator*(const vpImagePoint &ip1, const double scale)
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
static bool loadMatrix(const char *filename, vpMatrix &M, const bool binary=false, char *Header=NULL)
unsigned int rowNum
number of rows
Class that provides a data structure for the column vectors as well as a set of operations on these v...
unsigned int getCols() const
Return the number of columns of the matrix.
unsigned int dsize
Current size (rowNum * colNum)
unsigned int colNum
number of columns
Class that consider the case of a translation vector.
double * operator[](unsigned int n) const
read elements Aij (usage : x = A[i][j] )
static bool saveMatrix(std::string filename, const vpMatrix &M, const bool binary=false, const char *Header="")