36 #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(),
51 if (src.rows() != 4 || src.cols() != 4) {
55 Eigen::Map<Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> >(&dst.
data[0], src.rows(),
61 dst.
resize(
static_cast<unsigned int>(src.rows()));
62 #if (VP_VERSION_INT(EIGEN_WORLD_VERSION, EIGEN_MAJOR_VERSION, EIGEN_MINOR_VERSION) < 0x030300)
63 for (Eigen::DenseIndex i = 0; i < src.rows(); i++) {
65 for (Eigen::Index i = 0; i < src.rows(); i++) {
67 dst[
static_cast<unsigned int>(i)] = src(i);
73 dst.
resize(
static_cast<unsigned int>(src.cols()));
74 #if (VP_VERSION_INT(EIGEN_WORLD_VERSION, EIGEN_MAJOR_VERSION, EIGEN_MINOR_VERSION) < 0x030300)
75 for (Eigen::DenseIndex i = 0; i < src.cols(); i++) {
77 for (Eigen::Index i = 0; i < src.cols(); i++) {
79 dst[
static_cast<unsigned int>(i)] = src(i);
87 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 emitted 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)