gslpp_vector_double.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 HEPfit Collaboration
3  * All rights reserved.
4  *
5  * For the licensing terms see doc/COPYING.
6  */
7 
8 #ifndef GSLPP_VECTOR_DOUBLE_H
9 #define GSLPP_VECTOR_DOUBLE_H
10 #include <iostream>
11 #ifndef __GSL_VECTOR_DOUBLE_H__
12 # include <gsl/gsl_vector_double.h>
13 #endif
14 #ifndef GSLPP_COMPLEX_H
15 #include "gslpp_complex.h"
16 #endif
17 #ifndef GSLPP_VECTOR_BASE_H
18 #include "gslpp_vector_base.h"
19 #endif
20 
21 namespace gslpp
22 {
32  template <>
33  class vector<double>
34  {
35  gsl_vector *_vector;
36 
37  public:
39  vector(const size_t& size);
40  vector(const size_t& size, const double& a);
42  vector(const vector<double>& v);
43  vector(const gsl_vector& v);
44  vector(const gsl_vector* v);
46  ~vector();
48  const double& operator()(const size_t& i) const;
50  double& operator()(const size_t& i);
52  vector<double>& operator=(const vector<double>& v);
54  size_t size() const;
56  double mod() const;
58  double max() const;
60  double min() const;
62  gsl_vector* as_gsl_type_ptr() const;
63  gsl_vector& as_gsl_type();
64  const gsl_vector& as_gsl_type() const;
66  vector<double> operator-() const;
72  double operator*(const vector<double>& v);
74 // vector<double> operator^(const vector<double>& v);
76  vector<double>& operator+=(const vector<double>& v);
78  vector<double>& operator-=(const vector<double>& v);
80  vector<double> operator+(const double& a);
82  vector<double> operator-(const double& a);
84  vector<double> operator*(const double& a);
86  vector<double> operator/(const double& a);
88  vector<double>& operator+=(const double& a);
90  vector<double>& operator-=(const double& a);
92  vector<double>& operator*=(const double& a);
94  vector<double>& operator/=(const double& a);
103 
105  friend std::ostream& operator<<(std::ostream& output, const vector<double>& v);
115  friend vector<double> operator+(const double& a, vector<double> v);
116 
123  friend vector<double> operator-(const double& a, vector<double> v);
124 
131  friend vector<double> operator*(const double& a, vector<double> v);
132 
139  friend vector<complex> operator+(const complex& z, vector<double> v);
140 
147  friend vector<complex> operator-(const complex& z, vector<double> v);
148 
155  friend vector<complex> operator*(const complex& z, vector<double> v);
158  };
159 }
160 
161 #endif
complex operator*(const double &x1, const complex &z2)
A class for constructing and defining operations on complex vectors.
complex operator/(const double &x1, const complex &z2)
A class for constructing and defining operations on real vectors.
A base class for defining operations on vectors, both real and complex.
complex operator+(const double &x1, const complex &z2)
A class for defining operations on and functions of complex numbers.
Definition: gslpp_complex.h:35
complex operator-(const double &x1, const complex &z2)
Complex number, vector and matrix manipulation using GSL.