yat  0.21pre
BasicVector.h
1 #ifndef _theplu_yat_utility_basic_vector
2 #define _theplu_yat_utility_basic_vector
3 
4 // $Id: BasicVector.h 3605 2017-01-27 05:19:50Z peter $
5 
6 /*
7  Copyright (C) 2017 Peter Johansson
8 
9  This file is part of the yat library, http://dev.thep.lu.se/yat
10 
11  The yat library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU General Public License as
13  published by the Free Software Foundation; either version 3 of the
14  License, or (at your option) any later version.
15 
16  The yat library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with yat. If not, see <http://www.gnu.org/licenses/>.
23 */
24 
25 #include <gsl/gsl_vector.h>
26 
27 #include <cstddef>
28 
29 namespace theplu {
30 namespace yat {
31 namespace utility {
32 
47  template<class Derived>
49  {
50  public:
54  typedef Derived derived_type;
55 
59  double operator()(size_t i) const
60  { return (*static_cast<const Derived*>(this))(i); }
61 
65  const gsl_vector* gsl_vector_p(void) const
66  { return static_cast<const Derived*>(this)->gsl_vector_p(); }
67 
71  size_t size(void) const
72  { return static_cast<const Derived*>(this)->size(); }
73  };
74 
75 }}} // of namespace utility, yat, and theplu
76 
77 #endif
double operator()(size_t i) const
access element i
Definition: BasicVector.h:59
size_t size(void) const
Definition: BasicVector.h:71
The Department of Theoretical Physics namespace as we define it.
Definition: BasicVector.h:48
Derived derived_type
Definition: BasicVector.h:54
const gsl_vector * gsl_vector_p(void) const
Definition: BasicVector.h:65

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