Reference documentation for deal.II version 8.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
transpose_matrix.h
1 // ---------------------------------------------------------------------
2 // @f$Id: transpose_matrix.h 30036 2013-07-18 16:55:32Z maier @f$
3 //
4 // Copyright (C) 2002 - 2013 by the deal.II authors
5 //
6 // This file is part of the deal.II library.
7 //
8 // The deal.II library is free software; you can use it, redistribute
9 // it, and/or modify it under the terms of the GNU Lesser General
10 // Public License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 // The full text of the license can be found in the file LICENSE at
13 // the top level of the deal.II distribution.
14 //
15 // ---------------------------------------------------------------------
16 
17 #ifndef __deal2__transpose_matrix_h
18 #define __deal2__transpose_matrix_h
19 
20 
21 #include <deal.II/base/subscriptor.h>
22 #include <deal.II/lac/pointer_matrix.h>
23 
24 DEAL_II_NAMESPACE_OPEN
25 
26 
41 template<class MATRIX, class VECTOR>
42 class
44 {
45 public:
56  TransposeMatrix (const MATRIX *M=0);
57 
63  TransposeMatrix(const char *name);
64 
74  TransposeMatrix(const MATRIX *M,
75  const char *name);
76 
77  // Use doc from base class
78  virtual void clear();
79 
84  bool empty () const;
85 
92  const TransposeMatrix &operator= (const MATRIX *M);
93 
97  virtual void vmult (VECTOR &dst,
98  const VECTOR &src) const;
99 
103  virtual void Tvmult (VECTOR &dst,
104  const VECTOR &src) const;
105 
110  virtual void vmult_add (VECTOR &dst,
111  const VECTOR &src) const;
112 
117  virtual void Tvmult_add (VECTOR &dst,
118  const VECTOR &src) const;
119 
120 private:
125  virtual const void *get() const;
126 
131 };
132 
133 
134 //----------------------------------------------------------------------//
135 
136 
137 template<class MATRIX, class VECTOR>
139  : m(M)
140 {}
141 
142 
143 template<class MATRIX, class VECTOR>
145  : m(0, name)
146 {}
147 
148 
149 template<class MATRIX, class VECTOR>
151  const MATRIX *M,
152  const char *name)
153  : m(M, name)
154 {}
155 
156 
157 template<class MATRIX, class VECTOR>
158 inline void
160 {
161  m = 0;
162 }
163 
164 
165 template<class MATRIX, class VECTOR>
166 inline const TransposeMatrix<MATRIX, VECTOR> &
168 {
169  m = M;
170  return *this;
171 }
172 
173 
174 template<class MATRIX, class VECTOR>
175 inline bool
177 {
178  if (m == 0)
179  return true;
180  return m->empty();
181 }
182 
183 template<class MATRIX, class VECTOR>
184 inline void
186  const VECTOR &src) const
187 {
188  Assert (m != 0, ExcNotInitialized());
189  m->Tvmult (dst, src);
190 }
191 
192 
193 template<class MATRIX, class VECTOR>
194 inline void
196  const VECTOR &src) const
197 {
198  Assert (m != 0, ExcNotInitialized());
199  m->vmult (dst, src);
200 }
201 
202 
203 template<class MATRIX, class VECTOR>
204 inline void
206  const VECTOR &src) const
207 {
208  Assert (m != 0, ExcNotInitialized());
209  m->Tvmult_add (dst, src);
210 }
211 
212 
213 template<class MATRIX, class VECTOR>
214 inline void
216  const VECTOR &src) const
217 {
218  Assert (m != 0, ExcNotInitialized());
219  m->vmult_add (dst, src);
220 }
221 
222 
223 template<class MATRIX, class VECTOR>
224 inline const void *
226 {
227  return m;
228 }
229 
230 
231 
232 DEAL_II_NAMESPACE_CLOSE
233 
234 #endif
virtual void vmult(VECTOR &dst, const VECTOR &src) const
virtual void clear()
TransposeMatrix(const MATRIX *M=0)
#define Assert(cond, exc)
Definition: exceptions.h:299
virtual void Tvmult_add(VECTOR &dst, const VECTOR &src) const
virtual const void * get() const
SmartPointer< const MATRIX, TransposeMatrix< MATRIX, VECTOR > > m
virtual void vmult_add(VECTOR &dst, const VECTOR &src) const
bool empty() const
::ExceptionBase & ExcNotInitialized()
const TransposeMatrix & operator=(const MATRIX *M)
virtual void Tvmult(VECTOR &dst, const VECTOR &src) const