mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
don't use deprecated MappedSparseMatrix
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
11cb7b8372
commit
7e586635ba
@@ -1,69 +0,0 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// Copyright (C) 2008-2014 Gael Guennebaud <gael.guennebaud@inria.fr>
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_MAPPED_SPARSEMATRIX_H
|
||||
#define EIGEN_MAPPED_SPARSEMATRIX_H
|
||||
|
||||
#include "./InternalHeaderCheck.h"
|
||||
|
||||
namespace Eigen {
|
||||
|
||||
/** \deprecated Use Map<SparseMatrix<> >
|
||||
* \class MappedSparseMatrix
|
||||
*
|
||||
* \brief Sparse matrix
|
||||
*
|
||||
* \param Scalar_ the scalar type, i.e. the type of the coefficients
|
||||
*
|
||||
* See http://www.netlib.org/linalg/html_templates/node91.html for details on the storage scheme.
|
||||
*
|
||||
*/
|
||||
namespace internal {
|
||||
template<typename Scalar_, int _Flags, typename StorageIndex_>
|
||||
struct traits<MappedSparseMatrix<Scalar_, _Flags, StorageIndex_> > : traits<SparseMatrix<Scalar_, _Flags, StorageIndex_> >
|
||||
{};
|
||||
} // end namespace internal
|
||||
|
||||
template<typename Scalar_, int _Flags, typename StorageIndex_>
|
||||
class MappedSparseMatrix
|
||||
: public Map<SparseMatrix<Scalar_, _Flags, StorageIndex_> >
|
||||
{
|
||||
typedef Map<SparseMatrix<Scalar_, _Flags, StorageIndex_> > Base;
|
||||
|
||||
public:
|
||||
|
||||
typedef typename Base::StorageIndex StorageIndex;
|
||||
typedef typename Base::Scalar Scalar;
|
||||
|
||||
inline MappedSparseMatrix(Index rows, Index cols, Index nnz, StorageIndex* outerIndexPtr, StorageIndex* innerIndexPtr, Scalar* valuePtr, StorageIndex* innerNonZeroPtr = 0)
|
||||
: Base(rows, cols, nnz, outerIndexPtr, innerIndexPtr, valuePtr, innerNonZeroPtr)
|
||||
{}
|
||||
|
||||
/** Empty destructor */
|
||||
inline ~MappedSparseMatrix() {}
|
||||
};
|
||||
|
||||
namespace internal {
|
||||
|
||||
template<typename Scalar_, int Options_, typename StorageIndex_>
|
||||
struct evaluator<MappedSparseMatrix<Scalar_,Options_,StorageIndex_> >
|
||||
: evaluator<SparseCompressedBase<MappedSparseMatrix<Scalar_,Options_,StorageIndex_> > >
|
||||
{
|
||||
typedef MappedSparseMatrix<Scalar_,Options_,StorageIndex_> XprType;
|
||||
typedef evaluator<SparseCompressedBase<XprType> > Base;
|
||||
|
||||
evaluator() : Base() {}
|
||||
explicit evaluator(const XprType &mat) : Base(mat) {}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
} // end namespace Eigen
|
||||
|
||||
#endif // EIGEN_MAPPED_SPARSEMATRIX_H
|
||||
@@ -110,7 +110,7 @@ class SparseMatrix
|
||||
using Base::operator+=;
|
||||
using Base::operator-=;
|
||||
|
||||
typedef MappedSparseMatrix<Scalar,Flags,StorageIndex> Map;
|
||||
typedef Eigen::Map<SparseMatrix<Scalar,Flags,StorageIndex>> Map;
|
||||
typedef Diagonal<SparseMatrix> DiagonalReturnType;
|
||||
typedef Diagonal<const SparseMatrix> ConstDiagonalReturnType;
|
||||
typedef typename Base::InnerIterator InnerIterator;
|
||||
|
||||
@@ -135,7 +135,7 @@ class Ref<SparseMatrixType, Options>
|
||||
template<int OtherOptions>
|
||||
inline Ref(const SparseMatrix<MatScalar,OtherOptions,MatIndex>& expr);
|
||||
template<int OtherOptions>
|
||||
inline Ref(const MappedSparseMatrix<MatScalar,OtherOptions,MatIndex>& expr);
|
||||
inline Ref(const Map<SparseMatrix<MatScalar,OtherOptions,MatIndex>>& expr);
|
||||
public:
|
||||
|
||||
typedef internal::SparseRefBase<Ref> Base;
|
||||
@@ -150,15 +150,15 @@ class Ref<SparseMatrixType, Options>
|
||||
eigen_assert( ((Options & int(StandardCompressedFormat))==0) || (expr.isCompressed()) );
|
||||
Base::construct(expr.derived());
|
||||
}
|
||||
|
||||
|
||||
template<int OtherOptions>
|
||||
inline Ref(MappedSparseMatrix<MatScalar,OtherOptions,MatIndex>& expr)
|
||||
inline Ref(Map<SparseMatrix<MatScalar,OtherOptions,MatIndex> >& expr)
|
||||
{
|
||||
EIGEN_STATIC_ASSERT(bool(Traits::template match<SparseMatrix<MatScalar,OtherOptions,MatIndex> >::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH);
|
||||
eigen_assert( ((Options & int(StandardCompressedFormat))==0) || (expr.isCompressed()) );
|
||||
Base::construct(expr.derived());
|
||||
}
|
||||
|
||||
|
||||
template<typename Derived>
|
||||
inline Ref(const SparseCompressedBase<Derived>& expr)
|
||||
#else
|
||||
|
||||
@@ -53,7 +53,6 @@ const int RandomAccessPattern = 0x8 | OuterRandomAccessPattern | InnerRand
|
||||
|
||||
template<typename Scalar_, int _Flags = 0, typename StorageIndex_ = int> class SparseMatrix;
|
||||
template<typename Scalar_, int _Flags = 0, typename StorageIndex_ = int> class SparseVector;
|
||||
template<typename Scalar_, int _Flags = 0, typename StorageIndex_ = int> class MappedSparseMatrix;
|
||||
|
||||
template<typename MatrixType, unsigned int UpLo> class SparseSelfAdjointView;
|
||||
template<typename Lhs, typename Rhs> class SparseDiagonalProduct;
|
||||
|
||||
Reference in New Issue
Block a user