yat  0.14.5pre
Vector.h
1 #ifndef _theplu_yat_utility_vector_
2 #define _theplu_yat_utility_vector_
3 
4 // $Id: Vector.h 3101 2013-11-01 08:54:57Z 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 Peter Johansson
14 
15  This file is part of the yat library, http://dev.thep.lu.se/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 #include "Exception.h"
33 
34 #include <cstddef> // size_t
35 #include <iosfwd>
36 #include <stdexcept>
37 
38 #include <gsl/gsl_vector.h>
39 
40 namespace theplu {
41 namespace yat {
42 namespace utility {
43 
57  class Vector : public VectorMutable
58  {
59  public:
63  Vector(void);
64 
71  explicit Vector(size_t n, double init_value=0);
72 
79  Vector(const Vector& other);
80 
87  explicit Vector(const VectorBase& other);
88 
101  explicit Vector(std::istream &, char sep='\0')
102  throw(utility::IO_error, std::exception);
103 
107  ~Vector(void);
108 
112  bool isview(void) const;
113 
124  void resize(size_t, double init_value=0);
125 
135  const Vector& operator=(const Vector&);
136 
146  const Vector& operator=(const VectorBase&);
147 
148  private:
149  const Vector& assign(const VectorBase& other);
150 
162  gsl_vector* create_gsl_vector_copy(const VectorBase&) const;
163 
175  gsl_vector* create_gsl_vector(size_t n) const;
176 
177  void delete_allocated_memory(void);
178  };
179 
189  void swap(Vector&, Vector&);
190 
191 }}} // of namespace utility, yat, and theplu
192 
193 #endif
void resize(size_t, double init_value=0)
Resize Vector.
const Vector & operator=(const Vector &)
The assignment operator.
This is the yat interface to GSL vector.
Definition: Vector.h:57
This is the yat interface to GSL vector.
Definition: VectorBase.h:52
This is the mutable interface to GSL vector.
Definition: VectorMutable.h:55
Class to report errors associated with IO operations.
Definition: Exception.h:109
Vector(void)
The default constructor.
bool isview(void) const

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