34 #include <visp3/core/vpConfig.h>
36 #include "private/vpMatrix_pseudo_inverse.h"
40 #ifndef DOXYGEN_SHOULD_SKIP_THIS
42 #if defined(VISP_HAVE_OPENCV)
94 compute_pseudo_inverse(U, sv, V, nrows, ncols, svThreshold, Ap, rank_out,
nullptr,
nullptr,
nullptr,
nullptr);
145 unsigned int nrows =
getRows();
146 unsigned int ncols =
getCols();
151 Ap.
resize(ncols, nrows,
false,
false);
156 compute_pseudo_inverse(U, sv, V, nrows, ncols, svThreshold, Ap, rank_out,
nullptr,
nullptr,
nullptr,
nullptr);
158 return static_cast<unsigned int>(rank_out);
213 unsigned int nrows =
getRows();
214 unsigned int ncols =
getCols();
218 Ap.
resize(ncols, nrows,
false,
false);
223 compute_pseudo_inverse(U, sv, V, nrows, ncols, svThreshold, Ap, rank_out,
nullptr,
nullptr,
nullptr,
nullptr);
225 return static_cast<unsigned int>(rank_out);
341 unsigned int nrows =
getRows();
342 unsigned int ncols =
getCols();
347 U.
resize(ncols, ncols,
true);
356 compute_pseudo_inverse(U, sv, V, nrows, ncols, svThreshold, Ap, rank_out,
nullptr, &imA, &imAt, &kerAt);
358 return static_cast<unsigned int>(rank_out);
403 unsigned int nrows =
getRows();
404 unsigned int ncols =
getCols();
406 double svThreshold = 1e-26;
413 compute_pseudo_inverse(U, sv, V, nrows, ncols, svThreshold, Ap, rank_out, &rank_in,
nullptr,
nullptr,
nullptr);
470 unsigned int nrows =
getRows();
471 unsigned int ncols =
getCols();
473 double svThreshold = 1e-26;
477 Ap.
resize(ncols, nrows,
false,
false);
482 compute_pseudo_inverse(U, sv, V, nrows, ncols, svThreshold, Ap, rank_out, &rank_in,
nullptr,
nullptr,
nullptr);
546 unsigned int nrows =
getRows();
547 unsigned int ncols =
getCols();
549 double svThreshold = 1e-26;
552 Ap.
resize(ncols, nrows,
false,
false);
557 compute_pseudo_inverse(U, sv, V, nrows, ncols, svThreshold, Ap, rank_out, &rank_in,
nullptr,
nullptr,
nullptr);
680 unsigned int nrows =
getRows();
681 unsigned int ncols =
getCols();
683 double svThreshold = 1e-26;
687 U.
resize(ncols, ncols,
true);
696 compute_pseudo_inverse(U, sv, V, nrows, ncols, svThreshold, Ap, rank_out, &rank_in, &imA, &imAt, &kerAt);
unsigned int getCols() const
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true, bool recopy_=true)
unsigned int getRows() const
Implementation of column vector and the associated operations.
Implementation of a matrix and operations on matrices.
vpMatrix pseudoInverseOpenCV(double svThreshold=1e-6) const
void svdOpenCV(vpColVector &w, vpMatrix &V)
void insert(const vpMatrix &A, unsigned int r, unsigned int c)