Logo  0.95.0-final
Finite Element Embedded Library and Language in C++
Feel++ Feel++ on Github Feel++ community
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
matrixshellsparse.hpp
Go to the documentation of this file.
1 /* -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2 
3  This file is part of the Feel library
4 
5  Author(s): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
6  Date: 2008-12-28
7 
8  Copyright (C) 2008 Universite Joseph Fourier (Grenoble I)
9 
10  This library is free software; you can redistribute it and/or
11  modify it under the terms of the GNU Lesser General Public
12  License as published by the Free Software Foundation; either
13  version 3.0 of the License, or (at your option) any later version.
14 
15  This library is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public
21  License along with this library; if not, write to the Free Software
22  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 */
29 #ifndef __MatrixShellSparse_H
30 #define __MatrixShellSparse_H 1
31 
34 
35 namespace Feel
36 {
44 template<typename T>
45 class MatrixShellSparse : public MatrixShell<T>
46 {
47  typedef MatrixShell<T> super;
48 public:
49 
50 
54 
55  typedef typename super::value_type value_type;
56  typedef typename super::real_type real_type;
58  typedef boost::shared_ptr<sparse_matrix_type> sparse_matrix_ptrtype;
59  typedef typename super::vector_type vector_type;
60  typedef typename super::vector_ptrtype vector_ptrtype;
61 
63 
67 
68  MatrixShellSparse( sparse_matrix_ptrtype m ) : M_m( m ) {}
69  ~MatrixShellSparse() {}
70 
72 
76 
77 
79 
83 
88  virtual size_type size1 () const
89  {
90  return M_m->size1();
91  }
92 
97  virtual size_type size2 () const
98  {
99  return M_m->size2();
100  }
101 
103 
107 
108 
110 
114 
116  void diagonal( vector_type& v ) const;
117 
119  void multVector( vector_type const& in, vector_type& out ) const;
120 
122  void multAddVector( vector_type const& in, vector_type& out ) const;
123 
125 
126 
127 
128 protected:
129 
130 private:
131  sparse_matrix_ptrtype M_m;
132 };
133 }
134 #endif /* __MatrixShellSparse_H */

Generated on Fri Oct 25 2013 14:24:18 for Feel++ by doxygen 1.8.4