34 #include <visp3/core/vpEigenConversion.h>
38 #ifdef VISP_HAVE_EIGEN3
42 dst.
resize(
static_cast<unsigned int>(src.rows()),
static_cast<unsigned int>(src.cols()),
false,
false);
43 Eigen::Map<Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> >(&dst.
data[0], src.rows(),
49 const Eigen::Index index_4 = 4;
50 if ((src.rows() != index_4) || (src.cols() != index_4)) {
54 Eigen::Map<Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> >(&dst.
data[0], src.rows(),
60 dst.
resize(
static_cast<unsigned int>(src.rows()));
61 #if (VP_VERSION_INT(EIGEN_WORLD_VERSION, EIGEN_MAJOR_VERSION, EIGEN_MINOR_VERSION) < 0x030300)
62 Eigen::DenseIndex src_rows = src.rows();
63 for (Eigen::DenseIndex i = 0; i < src_rows; i++) {
65 Eigen::Index src_rows = src.rows();
66 for (Eigen::Index i = 0; i < src_rows; ++i) {
68 dst[
static_cast<unsigned int>(i)] = src(i);
74 dst.
resize(
static_cast<unsigned int>(src.cols()));
75 #if (VP_VERSION_INT(EIGEN_WORLD_VERSION, EIGEN_MAJOR_VERSION, EIGEN_MINOR_VERSION) < 0x030300)
76 Eigen::DenseIndex src_cols = src.cols();
77 for (Eigen::DenseIndex i = 0; i < src_cols; ++i) {
79 Eigen::Index src_cols = src.cols();
80 for (Eigen::Index i = 0; i < src_cols; ++i) {
82 dst[
static_cast<unsigned int>(i)] = src(i);
90 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)
VISP_EXPORT void eigen2visp(const Eigen::MatrixXd &src, vpMatrix &dst)
void visp2eigen(const vpMatrix &src, Eigen::MatrixBase< Derived > &dst)