a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
gslpp_vector_double.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 HEPfit Collaboration
3  *
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  void reset();
53  vector<double>& operator=(const vector<double>& v);
55  size_t size() const;
57  double mod() const;
59  double max() const;
61  double min() const;
63  gsl_vector* as_gsl_type_ptr() const;
64  gsl_vector& as_gsl_type();
65  const gsl_vector& as_gsl_type() const;
67  vector<double> operator-() const;
69  vector<double> operator+(const vector<double>& v) const;
72  vector<double> operator-(const vector<double>& v) const;
75  double operator*(const vector<double>& v) const;
76  complex operator*(const vector<complex>& v) const;
78 // vector<double> operator^(const vector<double>& v);
80  vector<double>& operator+=(const vector<double>& v);
82  vector<double>& operator-=(const vector<double>& v);
84  vector<double> operator+(const double& a) const;
86  vector<double> operator-(const double& a) const;
88  vector<double> operator*(const double& a) const;
90  vector<double> operator/(const double& a) const;
92  vector<double>& operator+=(const double& a);
94  vector<double>& operator-=(const double& a);
96  vector<double>& operator*=(const double& a);
98  vector<double>& operator/=(const double& a);
100  vector<complex> operator+(const complex& z) const;
102  vector<complex> operator-(const complex& z) const;
104  vector<complex> operator*(const complex& z) const;
106  vector<complex> operator/(const complex& z) const;
107 
109  bool operator==(const vector<double>& a) const;
110  bool operator!=(const vector<double>& a) const
111  {
112  return(!(*this == a));
113  }
114 
116  friend std::ostream& operator<<(std::ostream& output, const vector<double>& v);
126  friend vector<double> operator+(const double& a, vector<double> v);
127 
134  friend vector<double> operator-(const double& a, vector<double> v);
135 
142  friend vector<double> operator*(const double& a, vector<double> v);
143 
150  friend vector<complex> operator+(const complex& z, vector<double> v);
151 
158  friend vector<complex> operator-(const complex& z, vector<double> v);
159 
166  friend vector<complex> operator*(const complex& z, vector<double> v);
169  };
170 }
171 
172 #endif
gslpp::vector< complex >
A class for constructing and defining operations on complex vectors.
Definition: gslpp_vector_complex.h:33
gslpp::complex
A class for defining operations on and functions of complex numbers.
Definition: gslpp_complex.h:35
gslpp::operator+
complex operator+(const double &x1, const complex &z2)
Definition: gslpp_complex.cpp:302
gslpp::vector< double >::_vector
gsl_vector * _vector
Definition: gslpp_vector_double.h:35
gslpp::vector< double >
A class for constructing and defining operations on real vectors.
Definition: gslpp_vector_double.h:33
gslpp::operator/
complex operator/(const double &x1, const complex &z2)
Definition: gslpp_complex.cpp:320
gslpp::vector< double >::operator!=
bool operator!=(const vector< double > &a) const
Definition: gslpp_vector_double.h:110
gslpp::operator<<
std::ostream & operator<<(std::ostream &output, const complex &z)
Definition: gslpp_complex.cpp:143
gslpp_complex.h
gslpp::operator*
complex operator*(const double &x1, const complex &z2)
Definition: gslpp_complex.cpp:314
gslpp_vector_base.h
gslpp
Complex number, vector and matrix manipulation using GSL.
Definition: gslpp_complex.cpp:16
gslpp::vector
A base class for defining operations on vectors, both real and complex.
Definition: gslpp_vector_base.h:21
gslpp::operator-
complex operator-(const double &x1, const complex &z2)
Definition: gslpp_complex.cpp:308