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
matrixtriplet.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: 2007-05-22
7 
8  Copyright (C) 2007-2011 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 __MatrixTriplet_H
30 #define __MatrixTriplet_H 1
31 
32 namespace Feel
33 {
42 template<typename T>
44 {
45 public:
46 
47 
51 
52  typedef T value_type;
53 
55 
59 
60  MatrixTriplet( int nr, int nc,
61  std::vector<int> const& _Ti, std::vector<int> const& _Tj, std::vector<double> const& _Tx )
62  :
63  M_nr( nr ),
64  M_nc( nc ),
65  M_Ti( _Ti ),
66  M_Tj( _Tj ),
67  M_Tx( _Tx )
68  {}
69 
70  MatrixTriplet( MatrixTriplet const & mt )
71  :
72  M_nr( mt.M_nr ),
73  M_nc( mt.M_nc ),
74  M_Ti ( mt.M_Ti ),
75  M_Tj ( mt.M_Tj ),
76  M_Tx ( mt.M_Tx )
77  {}
78 
79  ~MatrixTriplet()
80  {}
81 
83 
87 
88 
90 
94 
95  int nrows() const
96  {
97  return M_nr;
98  }
99  int ncols() const
100  {
101  return M_nc;
102  }
103  int nz() const
104  {
105  return M_Ti.size();
106  }
107  int const* Ti() const
108  {
109  return &M_Ti[0];
110  }
111  int const* Tj() const
112  {
113  return &M_Tj[0];
114  }
115  value_type const* Tx() const
116  {
117  return &M_Tx[0];
118  }
119 
121 
125 
126 
128 
132 
133 
135 
136 
137 
138 protected:
139 
140 private:
141  int M_nr;
142  int M_nc;
143  std::vector<int> M_Ti;
144  std::vector<int> M_Tj;
145  std::vector<value_type> M_Tx;
146 };
147 }
148 #endif /* __MatrixTriplet_H */

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