ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
EigenConverter.cpp File Reference
Include dependency graph for EigenConverter.cpp:

Go to the source code of this file.

Namespaces

 cloudViewer
 Generic file read and write utility for python interface.
 
 cloudViewer::core
 
 cloudViewer::core::eigen_converter
 

Functions

template<typename func_t >
static void cloudViewer::core::eigen_converter::LaunchIndexFillKernel (const Indexer &indexer, const func_t &func)
 
template<typename T >
static Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > cloudViewer::core::eigen_converter::TensorToEigenMatrix (const core::Tensor &tensor)
 
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > cloudViewer::core::eigen_converter::TensorToEigenMatrixXd (const core::Tensor &tensor)
 Converts a 2D tensor to Eigen::MatrixXd of same shape. Regardless of the tensor dtype, the output will be converted to double. More...
 
Eigen::Matrix< float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > cloudViewer::core::eigen_converter::TensorToEigenMatrixXf (const core::Tensor &tensor)
 Converts a 2D tensor to Eigen::MatrixXf of same shape. Regardless of the tensor dtype, the output will be converted to float. More...
 
Eigen::Matrix< int, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > cloudViewer::core::eigen_converter::TensorToEigenMatrixXi (const core::Tensor &tensor)
 Converts a 2D tensor to Eigen::MatrixXi of same shape. Regardless of the tensor dtype, the output will be converted to int. More...
 
template<typename T , int N>
static std::vector< Eigen::Matrix< T, N, 1 > > cloudViewer::core::eigen_converter::TensorToEigenVectorNxVector (const core::Tensor &tensor)
 
template<typename T , int N>
static core::Tensor cloudViewer::core::eigen_converter::EigenVectorNxVectorToTensor (const std::vector< Eigen::Matrix< T, N, 1 >> &values, core::Dtype dtype, const core::Device &device)
 
std::vector< Eigen::Vector2d > cloudViewer::core::eigen_converter::TensorToEigenVector2dVector (const core::Tensor &tensor)
 Converts a tensor of shape (N, 2) to std::vector<Eigen::Vector2d>. An exception will be thrown if the tensor shape is not (N, 2). Regardless of the tensor dtype, the output will be converted to double. More...
 
std::vector< Eigen::Vector3d > cloudViewer::core::eigen_converter::TensorToEigenVector3dVector (const core::Tensor &tensor)
 Converts a tensor of shape (N, 3) to std::vector<Eigen::Vector3d>. An exception will be thrown if the tensor shape is not (N, 3). Regardless of the tensor dtype, the output will be converted to double. More...
 
std::vector< Eigen::Vector3i > cloudViewer::core::eigen_converter::TensorToEigenVector3iVector (const core::Tensor &tensor)
 Converts a tensor of shape (N, 3) to std::vector<Eigen::Vector3i>. An exception will be thrown if the tensor shape is not (N, 3). Regardless of the tensor dtype, the output will be converted to int. More...
 
std::vector< Eigen::Vector2i > cloudViewer::core::eigen_converter::TensorToEigenVector2iVector (const core::Tensor &tensor)
 Converts a tensor of shape (N, 2) to std::vector<Eigen::Vector2i>. An exception will be thrown if the tensor shape is not (N, 2). Regardless of the tensor dtype, the output will be converted to int. More...
 
core::Tensor cloudViewer::core::eigen_converter::EigenVector3dVectorToTensor (const std::vector< Eigen::Vector3d > &values, core::Dtype dtype, const core::Device &device)
 Converts a vector of Eigen::Vector3d to a (N, 3) tensor. This function also takes care of dtype conversion and device transfer if necessary. More...
 
core::Tensor cloudViewer::core::eigen_converter::EigenVector2dVectorToTensor (const std::vector< Eigen::Vector2d > &values, core::Dtype dtype, const core::Device &device)
 Converts a vector of Eigen::Vector2d to a (N, 2) tensor. This function also takes care of dtype conversion and device transfer if necessary. More...
 
core::Tensor cloudViewer::core::eigen_converter::EigenVector3iVectorToTensor (const std::vector< Eigen::Vector3i > &values, core::Dtype dtype, const core::Device &device)
 Converts a vector of Eigen::Vector3i to a (N, 3) tensor. This function also takes care of dtype conversion and device transfer if necessary. More...
 
core::Tensor cloudViewer::core::eigen_converter::EigenVector2iVectorToTensor (const std::vector< Eigen::Vector2i > &values, core::Dtype dtype, const core::Device &device)
 Converts a vector of Eigen::Vector2i to a (N, 2) tensor. This function also takes care of dtype conversion and device transfer if necessary. More...