yat  0.14.5pre
VectorView.h
1 #ifndef _theplu_yat_utility_vector_view_
2 #define _theplu_yat_utility_vector_view_
3 
4 // $Id: VectorView.h 2992 2013-03-03 05:03:44Z peter $
5 
6 /*
7  Copyright (C) 2003 Daniel Dalevi, Peter Johansson
8  Copyright (C) 2004 Jari Häkkinen, Peter Johansson
9  Copyright (C) 2005 Jari Häkkinen, Peter Johansson, Markus Ringnér
10  Copyright (C) 2006 Jari Häkkinen, Markus Ringnér
11  Copyright (C) 2007 Jari Häkkinen, Peter Johansson, Markus Ringnér
12  Copyright (C) 2008 Jari Häkkinen, Peter Johansson
13  Copyright (C) 2012 Peter Johansson
14 
15  This file is part of the yat library, http://dev.thep.lu.se/trac/yat
16 
17  The yat library is free software; you can redistribute it and/or
18  modify it under the terms of the GNU General Public License as
19  published by the Free Software Foundation; either version 3 of the
20  License, or (at your option) any later version.
21 
22  The yat library is distributed in the hope that it will be useful,
23  but WITHOUT ANY WARRANTY; without even the implied warranty of
24  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25  General Public License for more details.
26 
27  You should have received a copy of the GNU General Public License
28  along with yat. If not, see <http://www.gnu.org/licenses/>.
29 */
30 
31 #include "VectorMutable.h"
32 
33 #include <gsl/gsl_vector.h>
34 
35 namespace theplu {
36 namespace yat {
37 namespace utility {
38 
39  class Matrix;
40  class Vector;
41 
79  class VectorView : public VectorMutable
80  {
81  public:
87  VectorView(void);
88 
97  VectorView(VectorView& other);
98 
106  explicit VectorView(VectorMutable& other);
107 
118  VectorView(VectorMutable& v, size_t offset, size_t n, size_t stride=1);
119 
137  VectorView(Matrix& m, size_t i, bool row=true);
138 
142  ~VectorView(void);
143 
147  bool isview(void) const;
148 
158  const VectorView& operator=(const VectorView&);
159 
169  const VectorView& operator=(const VectorBase&);
170 
171  private:
172  const VectorView& assign(const VectorBase& other);
173  void copy(gsl_vector*);
174  void delete_allocated_memory(void);
175 
176  gsl_vector_view* view_;
177 
189  struct proxy
190  {
193  gsl_vector* vec_;
194  };
195 
196  public:
200  VectorView(proxy p);
201 
205  operator proxy();
206  };
207 
208 }}} // of namespace utility, yat, and theplu
209 
210 #endif
This is the yat interface to gsl_vector_view.
Definition: VectorView.h:79
VectorView(void)
Default constructor.
This is the yat interface to GSL vector.
Definition: VectorBase.h:52
gsl_vector * vec_
Definition: VectorMutable.h:232
This is the mutable interface to GSL vector.
Definition: VectorMutable.h:55
const VectorView & operator=(const VectorView &)
The assignment operator.
Interface to GSL matrix.
Definition: Matrix.h:63

Generated on Tue Sep 26 2017 02:33:29 for yat by  doxygen 1.8.5