is-approx.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2020-2024 INRIA
3  */
4 
5 #ifndef __eigenpy_utils_is_approx_hpp__
6 #define __eigenpy_utils_is_approx_hpp__
7 
8 #include <Eigen/Core>
9 #include <Eigen/SparseCore>
10 
11 namespace eigenpy {
12 template <typename MatrixType1, typename MatrixType2>
13 EIGEN_DONT_INLINE bool is_approx(const Eigen::MatrixBase<MatrixType1>& mat1,
14  const Eigen::MatrixBase<MatrixType2>& mat2,
15  const typename MatrixType1::RealScalar& prec) {
16  return mat1.isApprox(mat2, prec);
17 }
18 
19 template <typename MatrixType1, typename MatrixType2>
20 EIGEN_DONT_INLINE bool is_approx(const Eigen::MatrixBase<MatrixType1>& mat1,
21  const Eigen::MatrixBase<MatrixType2>& mat2) {
22  return is_approx(
23  mat1, mat2,
24  Eigen::NumTraits<typename MatrixType1::RealScalar>::dummy_precision());
25 }
26 
27 template <typename MatrixType1, typename MatrixType2>
28 EIGEN_DONT_INLINE bool is_approx(
29  const Eigen::SparseMatrixBase<MatrixType1>& mat1,
30  const Eigen::SparseMatrixBase<MatrixType2>& mat2,
31  const typename MatrixType1::RealScalar& prec) {
32  return mat1.isApprox(mat2, prec);
33 }
34 
35 template <typename MatrixType1, typename MatrixType2>
36 EIGEN_DONT_INLINE bool is_approx(
37  const Eigen::SparseMatrixBase<MatrixType1>& mat1,
38  const Eigen::SparseMatrixBase<MatrixType2>& mat2) {
39  return is_approx(
40  mat1, mat2,
41  Eigen::NumTraits<typename MatrixType1::RealScalar>::dummy_precision());
42 }
43 } // namespace eigenpy
44 
45 #endif // ifndef __eigenpy_utils_is_approx_hpp__
eigenpy::is_approx
EIGEN_DONT_INLINE bool is_approx(const Eigen::MatrixBase< MatrixType1 > &mat1, const Eigen::MatrixBase< MatrixType2 > &mat2, const typename MatrixType1::RealScalar &prec)
Definition: is-approx.hpp:13
eigenpy
Definition: alignment.hpp:14


eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Fri Apr 26 2024 02:17:35