Eigen  3.3.3
MappedSparseMatrix.h
00001 // This file is part of Eigen, a lightweight C++ template library
00002 // for linear algebra.
00003 //
00004 // Copyright (C) 2008-2014 Gael Guennebaud <gael.guennebaud@inria.fr>
00005 //
00006 // This Source Code Form is subject to the terms of the Mozilla
00007 // Public License v. 2.0. If a copy of the MPL was not distributed
00008 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
00009 
00010 #ifndef EIGEN_MAPPED_SPARSEMATRIX_H
00011 #define EIGEN_MAPPED_SPARSEMATRIX_H
00012 
00013 namespace Eigen {
00014 
00025 namespace internal {
00026 template<typename _Scalar, int _Flags, typename _StorageIndex>
00027 struct traits<MappedSparseMatrix<_Scalar, _Flags, _StorageIndex> > : traits<SparseMatrix<_Scalar, _Flags, _StorageIndex> >
00028 {};
00029 } // end namespace internal
00030 
00031 template<typename _Scalar, int _Flags, typename _StorageIndex>
00032 class MappedSparseMatrix
00033   : public Map<SparseMatrix<_Scalar, _Flags, _StorageIndex> >
00034 {
00035     typedef Map<SparseMatrix<_Scalar, _Flags, _StorageIndex> > Base;
00036 
00037   public:
00038     
00039     typedef typename Base::StorageIndex StorageIndex;
00040     typedef typename Base::Scalar Scalar;
00041 
00042     inline MappedSparseMatrix(Index rows, Index cols, Index nnz, StorageIndex* outerIndexPtr, StorageIndex* innerIndexPtr, Scalar* valuePtr, StorageIndex* innerNonZeroPtr = 0)
00043       : Base(rows, cols, nnz, outerIndexPtr, innerIndexPtr, valuePtr, innerNonZeroPtr)
00044     {}
00045 
00047     inline ~MappedSparseMatrix() {}
00048 };
00049 
00050 namespace internal {
00051 
00052 template<typename _Scalar, int _Options, typename _StorageIndex>
00053 struct evaluator<MappedSparseMatrix<_Scalar,_Options,_StorageIndex> >
00054   : evaluator<SparseCompressedBase<MappedSparseMatrix<_Scalar,_Options,_StorageIndex> > >
00055 {
00056   typedef MappedSparseMatrix<_Scalar,_Options,_StorageIndex> XprType;
00057   typedef evaluator<SparseCompressedBase<XprType> > Base;
00058   
00059   evaluator() : Base() {}
00060   explicit evaluator(const XprType &mat) : Base(mat) {}
00061 };
00062 
00063 }
00064 
00065 } // end namespace Eigen
00066 
00067 #endif // EIGEN_MAPPED_SPARSEMATRIX_H
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends