37 #include <visp3/core/vpEigenConversion.h>
40 #ifdef VISP_HAVE_EIGEN3
44 dst.
resize(
static_cast<unsigned int>(src.rows()),
static_cast<unsigned int>(src.cols()),
false,
false);
45 Eigen::Map<Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> >(&dst.
data[0], src.rows(), src.cols()) = src;
50 if (src.rows() != 4 || src.cols() != 4) {
54 Eigen::Map<Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> >(&dst.
data[0], src.rows(), src.cols()) = src;
59 dst.
resize(
static_cast<unsigned int>(src.rows()));
60 #if (VP_VERSION_INT(EIGEN_WORLD_VERSION, EIGEN_MAJOR_VERSION, EIGEN_MINOR_VERSION) < 0x030300)
61 for (Eigen::DenseIndex i = 0; i < src.rows(); i++) {
63 for (Eigen::Index i = 0; i < src.rows(); i++) {
65 dst[
static_cast<unsigned int>(i)] = src(i);
71 dst.
resize(
static_cast<unsigned int>(src.cols()));
72 #if (VP_VERSION_INT(EIGEN_WORLD_VERSION, EIGEN_MAJOR_VERSION, EIGEN_MINOR_VERSION) < 0x030300)
73 for (Eigen::DenseIndex i = 0; i < src.cols(); i++) {
75 for (Eigen::Index i = 0; i < src.cols(); i++) {
77 dst[
static_cast<unsigned int>(i)] = src(i);
83 dst = Eigen::VectorXd::Map(src.
data, src.
size());
88 dst = Eigen::RowVectorXd::Map(src.
data, src.
size());
Type * data
Address of the first element of the data array.
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true, bool recopy_=true)
unsigned int size() const
Return the number of elements of the 2D array.
Implementation of column vector and the associated operations.
void resize(unsigned int i, bool flagNullify=true)
error that can be emited by ViSP classes.
@ dimensionError
Bad dimension.
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of a matrix and operations on matrices.
Implementation of row vector and the associated operations.
void resize(unsigned int i, bool flagNullify=true)
void visp2eigen(const vpMatrix &src, Eigen::MatrixBase< Derived > &dst)
VISP_EXPORT void eigen2visp(const Eigen::MatrixXd &src, vpMatrix &dst)