31 #ifndef RCSPYSIM_EIGEN_MATND_H 32 #define RCSPYSIM_EIGEN_MATND_H 34 #include <Rcs_MatNd.h> 50 static_assert(std::is_same<typename M::Scalar, double>::value,
51 "MatNd is only compatible with double matrices.");
52 static_assert(M::IsRowMajor || M::IsVectorAtCompileTime,
53 "MatNd is only compatible with row major matrices or vectors.");
57 mat.size = src.size();
68 M::IsRowMajor || M::IsVectorAtCompileTime,
74 Eigen::RowMajor> >::type;
87 template<
typename M = Eigen::MatrixXd>
90 static_assert(std::is_same<typename M::Scalar, double>::value,
91 "MatNd is only compatible with double matrices.");
92 return Eigen::Map<MatNdMappable<M>>(src->ele, src->m, src->n);
105 template<
typename M = Eigen::MatrixXd>
108 static_assert(std::is_same<typename M::Scalar, double>::value,
109 "MatNd is only compatible with double matrices.");
110 return Eigen::Map<const MatNdMappable<M>>(src->ele, src->m, src->n);
122 dst = viewMatNd2Eigen<M>(src);
134 viewMatNd2Eigen<M>(dst) = src;
139 #endif //RCSPYSIM_EIGEN_MATND_H void copyMatNd2Eigen(M &dst, const MatNd *src)
Eigen::Map< MatNdMappable< M > > viewMatNd2Eigen(MatNd *src)
void copyEigen2MatNd(MatNd *dst, const M &src)
typename std::conditional< M::IsRowMajor||M::IsVectorAtCompileTime, M, Eigen::Matrix< typename M::Scalar, M::RowsAtCompileTime, M::ColsAtCompileTime, Eigen::RowMajor > >::type MatNdMappable
MatNd viewEigen2MatNd(M &src)