dense_vector_base.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef LIBMESH_DENSE_VECTOR_BASE_H
21 #define LIBMESH_DENSE_VECTOR_BASE_H
22 
23 
24 // Local Includes
25 #include "libmesh/libmesh_common.h"
26 
27 // C++ includes
28 
29 namespace libMesh
30 {
31 
32 
33 
34 
43 // ------------------------------------------------------------
44 // DenseVectorBase class definition
45 template<typename T>
46 class DenseVectorBase
47 {
48 public:
49 
54 
58  virtual ~DenseVectorBase() {}
59 
65  virtual void zero() = 0;
66 
70  virtual T el(const unsigned int i) const = 0;
71 
75  virtual T & el(const unsigned int i) = 0;
76 
80  virtual unsigned int size() const = 0;
81 
85  void print(std::ostream& os) const;
86 
91  friend std::ostream& operator << (std::ostream& os, const DenseVectorBase<T>& v)
92  {
93  v.print(os);
94  return os;
95  }
96 
101  void print_scientific(std::ostream& os) const;
102 
103 };
104 
105 
106 
107 // ------------------------------------------------------------
108 // DenseVectorBase member functions
109 
110 
111 
112 
113 } // namespace libMesh
114 
115 
116 
117 #endif // LIBMESH_DENSE_VECTOR_BASE_H

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:04 UTC

Hosted By:
SourceForge.net Logo