mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
56f9b810ab | ||
|
|
12815309a6 | ||
|
|
207747a518 | ||
|
|
5ecfdf2c00 | ||
|
|
e788869cf5 | ||
|
|
9df04bcede | ||
|
|
c31606c88a |
@@ -131,7 +131,7 @@ inline typename DenseBase<Derived>::Index DenseBase<Derived>::count() const
|
|||||||
|
|
||||||
/** \returns true is \c *this contains at least one Not A Number (NaN).
|
/** \returns true is \c *this contains at least one Not A Number (NaN).
|
||||||
*
|
*
|
||||||
* \sa isFinite()
|
* \sa allFinite()
|
||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
inline bool DenseBase<Derived>::hasNaN() const
|
inline bool DenseBase<Derived>::hasNaN() const
|
||||||
@@ -144,7 +144,7 @@ inline bool DenseBase<Derived>::hasNaN() const
|
|||||||
* \sa hasNaN()
|
* \sa hasNaN()
|
||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
inline bool DenseBase<Derived>::isFinite() const
|
inline bool DenseBase<Derived>::allFinite() const
|
||||||
{
|
{
|
||||||
return !((derived()-derived()).hasNaN());
|
return !((derived()-derived()).hasNaN());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -348,7 +348,7 @@ template<typename Derived> class DenseBase
|
|||||||
bool isOnes(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
bool isOnes(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
||||||
|
|
||||||
inline bool hasNaN() const;
|
inline bool hasNaN() const;
|
||||||
inline bool isFinite() const;
|
inline bool allFinite() const;
|
||||||
|
|
||||||
inline Derived& operator*=(const Scalar& other);
|
inline Derived& operator*=(const Scalar& other);
|
||||||
inline Derived& operator/=(const Scalar& other);
|
inline Derived& operator/=(const Scalar& other);
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
#define EIGEN_MACROS_H
|
#define EIGEN_MACROS_H
|
||||||
|
|
||||||
#define EIGEN_WORLD_VERSION 3
|
#define EIGEN_WORLD_VERSION 3
|
||||||
#define EIGEN_MAJOR_VERSION 1
|
#define EIGEN_MAJOR_VERSION 2
|
||||||
#define EIGEN_MINOR_VERSION 92
|
#define EIGEN_MINOR_VERSION 0
|
||||||
|
|
||||||
#define EIGEN_VERSION_AT_LEAST(x,y,z) (EIGEN_WORLD_VERSION>x || (EIGEN_WORLD_VERSION>=x && \
|
#define EIGEN_VERSION_AT_LEAST(x,y,z) (EIGEN_WORLD_VERSION>x || (EIGEN_WORLD_VERSION>=x && \
|
||||||
(EIGEN_MAJOR_VERSION>y || (EIGEN_MAJOR_VERSION>=y && \
|
(EIGEN_MAJOR_VERSION>y || (EIGEN_MAJOR_VERSION>=y && \
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ template<typename Derived> class SparseMatrixBase : public EigenBase<Derived>
|
|||||||
>::type AdjointReturnType;
|
>::type AdjointReturnType;
|
||||||
|
|
||||||
|
|
||||||
typedef SparseMatrix<Scalar, Flags&RowMajorBit ? RowMajor : ColMajor> PlainObject;
|
typedef SparseMatrix<Scalar, Flags&RowMajorBit ? RowMajor : ColMajor, Index> PlainObject;
|
||||||
|
|
||||||
|
|
||||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||||
|
|||||||
@@ -75,22 +75,22 @@ template<typename MatrixType, unsigned int UpLo> class SparseSelfAdjointView
|
|||||||
* Indeed, the SparseSelfadjointView operand is first copied into a temporary SparseMatrix before computing the product.
|
* Indeed, the SparseSelfadjointView operand is first copied into a temporary SparseMatrix before computing the product.
|
||||||
*/
|
*/
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
SparseSparseProduct<SparseMatrix<Scalar, ((internal::traits<OtherDerived>::Flags&RowMajorBit) ? RowMajor : ColMajor),Index>, OtherDerived>
|
SparseSparseProduct<typename OtherDerived::PlainObject, OtherDerived>
|
||||||
operator*(const SparseMatrixBase<OtherDerived>& rhs) const
|
operator*(const SparseMatrixBase<OtherDerived>& rhs) const
|
||||||
{
|
{
|
||||||
return SparseSparseProduct<SparseMatrix<Scalar, (internal::traits<OtherDerived>::Flags&RowMajorBit) ? RowMajor : ColMajor, Index>, OtherDerived>(*this, rhs.derived());
|
return SparseSparseProduct<typename OtherDerived::PlainObject, OtherDerived>(*this, rhs.derived());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \returns an expression of the matrix product between a sparse matrix \a lhs and a sparse self-adjoint matrix \a rhs.
|
/** \returns an expression of the matrix product between a sparse matrix \a lhs and a sparse self-adjoint matrix \a rhs.
|
||||||
*
|
*
|
||||||
* Note that there is no algorithmic advantage of performing such a product compared to a general sparse-sparse matrix product.
|
* Note that there is no algorithmic advantage of performing such a product compared to a general sparse-sparse matrix product.
|
||||||
* Indeed, the SparseSelfadjointView operand is first copied into a temporary SparseMatrix before computing the product.
|
* Indeed, the SparseSelfadjointView operand is first copied into a temporary SparseMatrix before computing the product.
|
||||||
*/
|
*/
|
||||||
template<typename OtherDerived> friend
|
template<typename OtherDerived> friend
|
||||||
SparseSparseProduct<OtherDerived, SparseMatrix<Scalar, ((internal::traits<OtherDerived>::Flags&RowMajorBit) ? RowMajor : ColMajor),Index> >
|
SparseSparseProduct<OtherDerived, typename OtherDerived::PlainObject >
|
||||||
operator*(const SparseMatrixBase<OtherDerived>& lhs, const SparseSelfAdjointView& rhs)
|
operator*(const SparseMatrixBase<OtherDerived>& lhs, const SparseSelfAdjointView& rhs)
|
||||||
{
|
{
|
||||||
return SparseSparseProduct< OtherDerived, SparseMatrix<Scalar, (internal::traits<OtherDerived>::Flags&RowMajorBit) ? RowMajor : ColMajor, Index> >(lhs.derived(), rhs.derived());
|
return SparseSparseProduct<OtherDerived, typename OtherDerived::PlainObject>(lhs.derived(), rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Efficient sparse self-adjoint matrix times dense vector/matrix product */
|
/** Efficient sparse self-adjoint matrix times dense vector/matrix product */
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ template<typename Scalar> void special_numbers()
|
|||||||
mboth = mnan + minf;
|
mboth = mnan + minf;
|
||||||
|
|
||||||
VERIFY(!m1.hasNaN());
|
VERIFY(!m1.hasNaN());
|
||||||
VERIFY(m1.isFinite());
|
VERIFY(m1.allFinite());
|
||||||
|
|
||||||
VERIFY(mnan.hasNaN());
|
VERIFY(mnan.hasNaN());
|
||||||
VERIFY((s1*mnan).hasNaN());
|
VERIFY((s1*mnan).hasNaN());
|
||||||
@@ -42,11 +42,11 @@ template<typename Scalar> void special_numbers()
|
|||||||
VERIFY(mboth.hasNaN());
|
VERIFY(mboth.hasNaN());
|
||||||
VERIFY(mboth.array().hasNaN());
|
VERIFY(mboth.array().hasNaN());
|
||||||
|
|
||||||
VERIFY(!mnan.isFinite());
|
VERIFY(!mnan.allFinite());
|
||||||
VERIFY(!minf.isFinite());
|
VERIFY(!minf.allFinite());
|
||||||
VERIFY(!(minf-mboth).isFinite());
|
VERIFY(!(minf-mboth).allFinite());
|
||||||
VERIFY(!mboth.isFinite());
|
VERIFY(!mboth.allFinite());
|
||||||
VERIFY(!mboth.array().isFinite());
|
VERIFY(!mboth.array().allFinite());
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_special_numbers()
|
void test_special_numbers()
|
||||||
|
|||||||
Reference in New Issue
Block a user