Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:34:41

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_MAPPED_SPARSEMATRIX_H
0011 #define EIGEN_MAPPED_SPARSEMATRIX_H
0012 
0013 namespace Eigen {
0014 
0015 /** \deprecated Use Map<SparseMatrix<> >
0016   * \class MappedSparseMatrix
0017   *
0018   * \brief Sparse matrix
0019   *
0020   * \param _Scalar the scalar type, i.e. the type of the coefficients
0021   *
0022   * See http://www.netlib.org/linalg/html_templates/node91.html for details on the storage scheme.
0023   *
0024   */
0025 namespace internal {
0026 template<typename _Scalar, int _Flags, typename _StorageIndex>
0027 struct traits<MappedSparseMatrix<_Scalar, _Flags, _StorageIndex> > : traits<SparseMatrix<_Scalar, _Flags, _StorageIndex> >
0028 {};
0029 } // end namespace internal
0030 
0031 template<typename _Scalar, int _Flags, typename _StorageIndex>
0032 class MappedSparseMatrix
0033   : public Map<SparseMatrix<_Scalar, _Flags, _StorageIndex> >
0034 {
0035     typedef Map<SparseMatrix<_Scalar, _Flags, _StorageIndex> > Base;
0036 
0037   public:
0038     
0039     typedef typename Base::StorageIndex StorageIndex;
0040     typedef typename Base::Scalar Scalar;
0041 
0042     inline MappedSparseMatrix(Index rows, Index cols, Index nnz, StorageIndex* outerIndexPtr, StorageIndex* innerIndexPtr, Scalar* valuePtr, StorageIndex* innerNonZeroPtr = 0)
0043       : Base(rows, cols, nnz, outerIndexPtr, innerIndexPtr, valuePtr, innerNonZeroPtr)
0044     {}
0045 
0046     /** Empty destructor */
0047     inline ~MappedSparseMatrix() {}
0048 };
0049 
0050 namespace internal {
0051 
0052 template<typename _Scalar, int _Options, typename _StorageIndex>
0053 struct evaluator<MappedSparseMatrix<_Scalar,_Options,_StorageIndex> >
0054   : evaluator<SparseCompressedBase<MappedSparseMatrix<_Scalar,_Options,_StorageIndex> > >
0055 {
0056   typedef MappedSparseMatrix<_Scalar,_Options,_StorageIndex> XprType;
0057   typedef evaluator<SparseCompressedBase<XprType> > Base;
0058   
0059   evaluator() : Base() {}
0060   explicit evaluator(const XprType &mat) : Base(mat) {}
0061 };
0062 
0063 }
0064 
0065 } // end namespace Eigen
0066 
0067 #endif // EIGEN_MAPPED_SPARSEMATRIX_H