39 #include <visp3/core/vpConfig.h>
41 #include <visp3/core/vpColVector.h>
42 #include <visp3/core/vpMath.h>
43 #include <visp3/core/vpMatrix.h>
46 #include <visp3/core/vpException.h>
47 #include <visp3/core/vpMatrixException.h>
50 #include <visp3/core/vpDebug.h>
52 #if (VISP_HAVE_OPENCV_VERSION >= 0x020101) // Require opencv >= 2.1.1
53 #include <opencv2/core/core.hpp>
56 #ifdef VISP_HAVE_LAPACK
59 typedef MKL_INT integer;
61 # ifdef VISP_HAVE_LAPACK_BUILT_IN
62 typedef long int integer;
66 extern "C" void dpotrf_(
char *uplo, integer *n,
double *a, integer *lda, integer *info);
67 extern "C" int dpotri_(
char *uplo, integer *n,
double *a, integer *lda, integer *info);
111 #if defined(VISP_HAVE_LAPACK)
113 #elif (VISP_HAVE_OPENCV_VERSION >= 0x020101)
117 "Cholesky. Install Lapack or "
118 "OpenCV 3rd party"));
122 #if defined(VISP_HAVE_LAPACK)
166 integer rowNum_ = (integer)this->
getRows();
167 integer lda = (integer)rowNum_;
171 dpotrf_((
char *)
"L", &rowNum_, A.
data, &lda, &info);
176 dpotri_((
char *)
"L", &rowNum_, A.
data, &lda, &info);
178 std::cout <<
"cholesky:dpotri_:error" << std::endl;
182 for (
unsigned int i = 0; i < A.
getRows(); i++)
183 for (
unsigned int j = 0; j < A.
getCols(); j++)
191 #if (VISP_HAVE_OPENCV_VERSION >= 0x020101)
236 cv::Mat Minv = M.inv(cv::DECOMP_CHOLESKY);
239 memcpy(A.
data, Minv.data, (
size_t)(8 * Minv.rows * Minv.cols));