Download include/eigen/bench/BenchUtil.h from adfa5456/FastRobustICP: direct link, hf CLI and curl.
- Browser
- Download file 2.53 kB
-
https://huggingface.co/datasets/adfa5456/FastRobustICP/resolve/main/include/eigen/bench/BenchUtil.h
- Command line
-
hf download hf://datasets/adfa5456/FastRobustICP/include/eigen/bench/BenchUtil.h
-
curl -L -o BenchUtil.h https://huggingface.co/datasets/adfa5456/FastRobustICP/resolve/main/include/eigen/bench/BenchUtil.h
2.53 kB
| using namespace std; | |
| using namespace Eigen; | |
| template<typename MatrixType> void initMatrix_random(MatrixType& mat) __attribute__((noinline)); | |
| template<typename MatrixType> void initMatrix_random(MatrixType& mat) | |
| { | |
| mat.setRandom();// = MatrixType::random(mat.rows(), mat.cols()); | |
| } | |
| template<typename MatrixType> void initMatrix_identity(MatrixType& mat) __attribute__((noinline)); | |
| template<typename MatrixType> void initMatrix_identity(MatrixType& mat) | |
| { | |
| mat.setIdentity(); | |
| } | |
| template <typename EigenMatrixType, typename GmmMatrixType> | |
| void eiToGmm(const EigenMatrixType& src, GmmMatrixType& dst) | |
| { | |
| dst.resize(src.rows(),src.cols()); | |
| for (int j=0; j<src.cols(); ++j) | |
| for (int i=0; i<src.rows(); ++i) | |
| dst(i,j) = src.coeff(i,j); | |
| } | |
| template <typename EigenMatrixType> | |
| void eiToGsl(const EigenMatrixType& src, gsl_matrix** dst) | |
| { | |
| for (int j=0; j<src.cols(); ++j) | |
| for (int i=0; i<src.rows(); ++i) | |
| gsl_matrix_set(*dst, i, j, src.coeff(i,j)); | |
| } | |
| template <typename EigenMatrixType, typename UblasMatrixType> | |
| void eiToUblas(const EigenMatrixType& src, UblasMatrixType& dst) | |
| { | |
| dst.resize(src.rows(),src.cols()); | |
| for (int j=0; j<src.cols(); ++j) | |
| for (int i=0; i<src.rows(); ++i) | |
| dst(i,j) = src.coeff(i,j); | |
| } | |
| template <typename EigenType, typename UblasType> | |
| void eiToUblasVec(const EigenType& src, UblasType& dst) | |
| { | |
| dst.resize(src.size()); | |
| for (int j=0; j<src.size(); ++j) | |
| dst[j] = src.coeff(j); | |
| } | |