Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/eigen3/Eigen/src/SparseCore/SparseFuzzy.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // This file is part of Eigen, a lightweight C++ template library
0002 // for linear algebra.
0003 //
0004 // Copyright (C) 2008-2014 Gael Guennebaud <gael.guennebaud@inria.fr>
0005 //
0006 // This Source Code Form is subject to the terms of the Mozilla
0007 // Public License v. 2.0. If a copy of the MPL was not distributed
0008 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
0009 
0010 #ifndef EIGEN_SPARSE_FUZZY_H
0011 #define EIGEN_SPARSE_FUZZY_H
0012 
0013 namespace Eigen {
0014   
0015 template<typename Derived>
0016 template<typename OtherDerived>
0017 bool SparseMatrixBase<Derived>::isApprox(const SparseMatrixBase<OtherDerived>& other, const RealScalar &prec) const
0018 {
0019   const typename internal::nested_eval<Derived,2,PlainObject>::type actualA(derived());
0020   typename internal::conditional<bool(IsRowMajor)==bool(OtherDerived::IsRowMajor),
0021     const typename internal::nested_eval<OtherDerived,2,PlainObject>::type,
0022     const PlainObject>::type actualB(other.derived());
0023 
0024   return (actualA - actualB).squaredNorm() <= prec * prec * numext::mini(actualA.squaredNorm(), actualB.squaredNorm());
0025 }
0026 
0027 } // end namespace Eigen
0028 
0029 #endif // EIGEN_SPARSE_FUZZY_H