src
extern
eigen3
Eigen
src
SparseCore
SparseFuzzy.h
Go to the documentation of this file.
1
// This file is part of Eigen, a lightweight C++ template library
2
// for linear algebra.
3
//
4
// Copyright (C) 2008-2014 Gael Guennebaud <gael.guennebaud@inria.fr>
5
//
6
// This Source Code Form is subject to the terms of the Mozilla
7
// Public License v. 2.0. If a copy of the MPL was not distributed
8
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
10
#ifndef EIGEN_SPARSE_FUZZY_H
11
#define EIGEN_SPARSE_FUZZY_H
12
13
namespace
Eigen
{
14
15
template
<
typename
Derived>
16
template
<
typename
OtherDerived>
17
bool
SparseMatrixBase<Derived>::isApprox
(
const
SparseMatrixBase<OtherDerived>
& other,
const
RealScalar
&prec)
const
18
{
19
const
typename
internal::nested_eval<Derived,2,PlainObject>::type
actualA(derived());
20
typename
internal::conditional
<bool(IsRowMajor)==bool(OtherDerived::IsRowMajor),
21
const
typename
internal::nested_eval<OtherDerived,2,PlainObject>::type
,
22
const
PlainObject
>::type actualB(other.
derived
());
23
24
return
(actualA - actualB).squaredNorm() <= prec * prec *
numext::mini
(actualA.squaredNorm(), actualB.squaredNorm());
25
}
26
27
}
// end namespace Eigen
28
29
#endif // EIGEN_SPARSE_FUZZY_H
Eigen
Definition:
common.h:73
Eigen::SparseMatrix
A versatible sparse matrix representation.
Definition:
SparseMatrix.h:96
Eigen::SparseMatrixBase::isApprox
bool isApprox(const SparseMatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition:
SparseFuzzy.h:17
Eigen::internal::true_type
Definition:
Meta.h:54
Eigen::numext::mini
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T mini(const T &x, const T &y)
Definition:
Eigen/src/Core/MathFunctions.h:817
Eigen::internal::conditional
Definition:
Meta.h:58
Eigen::SparseMatrixBase
Base class of any sparse matrices or sparse expressions.
Definition:
ForwardDeclarations.h:281
Eigen::SparseMatrixBase::derived
const Derived & derived() const
Definition:
SparseMatrixBase.h:138
Eigen::SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::RealScalar
NumTraits< Scalar >::Real RealScalar
Definition:
SparseMatrixBase.h:123
control_box_rst
Author(s): Christoph Rösmann
autogenerated on Wed Mar 2 2022 00:06:18