Skip to content

Commit 1da8153

Browse files
committed
utils: fix is_approx for complex types
1 parent 91866cf commit 1da8153

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/eigenpy/utils/is-approx.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace eigenpy {
1212
template <typename MatrixType1, typename MatrixType2>
1313
EIGEN_DONT_INLINE bool is_approx(const Eigen::MatrixBase<MatrixType1>& mat1,
1414
const Eigen::MatrixBase<MatrixType2>& mat2,
15-
const typename MatrixType1::Scalar& prec) {
15+
const typename MatrixType1::RealScalar& prec) {
1616
return mat1.isApprox(mat2, prec);
1717
}
1818

@@ -21,14 +21,14 @@ EIGEN_DONT_INLINE bool is_approx(const Eigen::MatrixBase<MatrixType1>& mat1,
2121
const Eigen::MatrixBase<MatrixType2>& mat2) {
2222
return is_approx(
2323
mat1, mat2,
24-
Eigen::NumTraits<typename MatrixType1::Scalar>::dummy_precision());
24+
Eigen::NumTraits<typename MatrixType1::RealScalar>::dummy_precision());
2525
}
2626

2727
template <typename MatrixType1, typename MatrixType2>
2828
EIGEN_DONT_INLINE bool is_approx(
2929
const Eigen::SparseMatrixBase<MatrixType1>& mat1,
3030
const Eigen::SparseMatrixBase<MatrixType2>& mat2,
31-
const typename MatrixType1::Scalar& prec) {
31+
const typename MatrixType1::RealScalar& prec) {
3232
return mat1.isApprox(mat2, prec);
3333
}
3434

@@ -38,7 +38,7 @@ EIGEN_DONT_INLINE bool is_approx(
3838
const Eigen::SparseMatrixBase<MatrixType2>& mat2) {
3939
return is_approx(
4040
mat1, mat2,
41-
Eigen::NumTraits<typename MatrixType1::Scalar>::dummy_precision());
41+
Eigen::NumTraits<typename MatrixType1::RealScalar>::dummy_precision());
4242
}
4343
} // namespace eigenpy
4444

0 commit comments

Comments
 (0)