41 #include <visp3/core/vpConfig.h>
42 #include <visp3/core/vpException.h>
43 #include <visp3/core/vpTime.h>
44 #include <visp3/core/vpArray2D.h>
45 #include <visp3/core/vpRotationMatrix.h>
46 #include <visp3/core/vpHomogeneousMatrix.h>
47 #include <visp3/core/vpVelocityTwistMatrix.h>
48 #include <visp3/core/vpForceTwistMatrix.h>
51 # include <gsl/gsl_math.h>
52 # include <gsl/gsl_eigen.h>
129 unsigned int nrows,
unsigned int ncols) ;
161 rowNum = colNum = dsize = 0;
169 void diag(
const double &val = 1.0);
173 void eye(
unsigned int n) ;
175 void eye(
unsigned int m,
unsigned int n) ;
215 void insert(
const vpMatrix&A,
const unsigned int r,
const unsigned int c);
224 vpRowVector getRow(
const unsigned int i,
const unsigned int j_begin,
const unsigned int size)
const;
226 vpColVector getCol(
const unsigned int j,
const unsigned int i_begin,
const unsigned int size)
const;
227 void init(
const vpMatrix &M,
unsigned int r,
unsigned int c,
unsigned int nrows,
unsigned int ncols);
251 vpMatrix &operator+=(
const double x);
253 vpMatrix &operator-=(
const double x);
255 vpMatrix &operator*=(
const double x);
262 vpMatrix operator/(
const double x)
const;
270 double sumSquare()
const;
272 double det(vpDetMethod method = LU_DECOMPOSITION)
const;
313 #ifndef DOXYGEN_SHOULD_SKIP_THIS
314 void LUDcmp(
unsigned int* perm,
int& d);
319 #endif // doxygen should skip this
322 #if defined(VISP_HAVE_LAPACK_C)
326 vpMatrix inverseByCholeskyLapack()
const;
332 vpMatrix pseudoInverse(
double svThreshold=1e-6)
const;
336 unsigned int pseudoInverse(
vpMatrix &Ap,
double svThreshold=1e-6)
const;
342 unsigned int pseudoInverse(
vpMatrix &Ap,
348 unsigned int pseudoInverse(
vpMatrix &Ap,
359 #ifndef DOXYGEN_SHOULD_SKIP_THIS
365 #if (VISP_HAVE_OPENCV_VERSION >= 0x020101) // Require opencv >= 2.1.1
368 #ifdef VISP_HAVE_LAPACK_C
388 unsigned int kernel(
vpMatrix &KerA,
double svThreshold=1e-6)
const;
408 double euclideanNorm()
const;
409 double infinityNorm()
const;
417 std::ostream & cppPrint(std::ostream & os,
const std::string &matrixName =
"A",
bool octet =
false)
const;
418 std::ostream & csvPrint(std::ostream & os)
const;
419 std::ostream & maplePrint(std::ostream & os)
const;
420 std::ostream & matlabPrint(std::ostream & os)
const;
421 int print(std::ostream& s,
unsigned int length,
char const* intro=0)
const;
473 static void add2WeightedMatrices(
const vpMatrix &A,
const double &wA,
const vpMatrix &B,
const double &wB,
vpMatrix &C);
474 static void computeHLM(
const vpMatrix &H,
const double &alpha,
vpMatrix &HLM);
524 const bool binary =
false,
char *header = NULL)
556 const bool binary =
false,
557 const char *header =
"")
579 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
620 vp_deprecated
void setIdentity(
const double & val=1.0) ;
622 vp_deprecated
vpRowVector row(
const unsigned int i);
623 vp_deprecated
vpColVector column(
const unsigned int j);
629 double detByLU()
const;
637 #ifndef DOXYGEN_SHOULD_SKIP_THIS
Implementation of a matrix and operations on matrices.
static bool save(const std::string &filename, const vpArray2D< Type > &A, const bool binary=false, const char *header="")
static bool saveYAML(const std::string &filename, const vpArray2D< Type > &A, const char *header="")
static bool loadMatrix(const std::string &filename, vpArray2D< double > &M, const bool binary=false, char *header=NULL)
vpArray2D< Type > & operator=(Type x)
Set all the elements of the array to x.
static bool loadYAML(const std::string &filename, vpArray2D< Type > &A, char *header=NULL)
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of row vector and the associated operations.
vpColVector operator*(const double &x, const vpColVector &v)
void stack(const vpMatrix &A)
vp_deprecated void stackMatrices(const vpMatrix &A)
Implementation of a generic 2D array used as vase class of matrices and vectors.
unsigned int getCols() const
Return the number of columns of the 2D array.
vpMatrix(unsigned int r, unsigned int c, double val)
Implementation of a rotation matrix and operations on such kind of matrices.
vpColVector operator*(const double &x, const vpColVector &v)
static vp_deprecated void stackMatrices(const vpMatrix &A, const vpMatrix &B, vpMatrix &C)
vp_deprecated void init()
static bool load(const std::string &filename, vpArray2D< Type > &A, const bool binary=false, char *header=NULL)
friend std::ostream & operator<<(std::ostream &s, const vpArray2D< Type > &A)
Implementation of a velocity twist matrix and operations on such kind of matrices.
unsigned int getRows() const
Return the number of rows of the 2D array.
static vp_deprecated vpMatrix stackMatrices(const vpMatrix &A, const vpMatrix &B)
vpMatrix(unsigned int r, unsigned int c)
Implementation of a force/torque twist matrix and operations on such kind of matrices.
Implementation of column vector and the associated operations.
virtual ~vpMatrix()
Destructor (Memory de-allocation)
static bool saveMatrixYAML(const std::string &filename, const vpArray2D< double > &M, const char *header="")
static bool saveMatrix(const std::string &filename, const vpArray2D< double > &M, const bool binary=false, const char *header="")
vpMatrix(const vpArray2D< double > &A)
Class that consider the case of a translation vector.
static bool loadMatrixYAML(const std::string &filename, vpArray2D< double > &M, char *header=NULL)