yat  0.21pre
VectorConstView.h
1 #ifndef _theplu_yat_utility_vector_const_view_
2 #define _theplu_yat_utility_vector_const_view_
3 
4 // $Id: VectorConstView.h 4207 2022-08-26 04:36:28Z 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) 2009, 2012, 2017, 2021, 2022 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 "VectorBase.h"
32 
33 #include <gsl/gsl_vector.h>
34 
35 namespace theplu {
36 namespace yat {
37 namespace utility {
38 
39  class MatrixBase;
40  class VectorView;
41 
56  class VectorConstView : public VectorBase
57  {
58  public:
62  // needed to override compiler generated copy constructor
63  VectorConstView(const VectorConstView& other);
64 
73  VectorConstView(const VectorView& other);
74 
78  explicit VectorConstView(const VectorBase& other);
79 
92  VectorConstView(const VectorBase& v,size_t offset,size_t n,size_t stride=1);
93 
112  VectorConstView(const MatrixBase& m, size_t i, bool row=true);
113 
119  explicit VectorConstView(const gsl_vector* v);
120 
127  VectorConstView(const double* v, size_t size, size_t stride=1);
128 
132  ~VectorConstView(void);
133 
137  bool isview(void) const;
138 
139  private:
140  void copy(const VectorBase& other);
141  void delete_allocated_memory(void);
142 
143  // Perhaps not needed - only used to create a gsl_vector (that is
144  // stored in base class). For data access use data in base class
145  // because this pointer may be NULL.
146  gsl_vector_const_view* const_view_;
147 
148  // assignment not allowed
149  VectorConstView& operator=(const VectorConstView&);
150  };
151 
152 }}} // of namespace utility, yat, and theplu
153 
154 #endif
Definition: MatrixBase.h:54
The Department of Theoretical Physics namespace as we define it.
This is the yat interface to gsl_vector_view.
Definition: VectorView.h:79
Read-only view.
Definition: VectorConstView.h:56
This is the yat interface to GSL vector.
Definition: VectorBase.h:55
VectorConstView(const VectorConstView &other)
The copy constructor.

Generated on Wed Jan 25 2023 03:34:29 for yat by  doxygen 1.8.14